Entering keystrokes that aren't on my keyboard.

lanz_the_joiner

2016-08-12 00:57:46

Short story is, I want to output F13 and F14 as keystrokes, but my keyboard doesn't have those keys. A workaround for some applications is to use shift+F1 and so on, but this isn't an option for me because the software I'm using has its own interpretation of those key commands - so I think it needs to be F13 and F14. Is there a way to enter in these keystrokes without actually hitting the keys? Or maybe there's an on-screen keyboard one can use?

I'm trying to set up my Xone K2 to control Photoshop CS6. While looking at the data coming from my Wacom tablet, I've noticed that when I turn my finger around its touch wheel when it is set to rotate the canvas in Photoshop, it sends the messages F13 and F14. This means it would be super easy to set one of the endless rotary encoders on the Xone K2 to rotate the canvas, and it would work way more naturally than the rather unpredictable touch-sensitive wheel on my graphics tablet. If only I could enter those keystrokes into the little box!

lanz_the_joiner

2016-08-12 20:45:40

Okay so I managed to get this one working! I was being silly and didn't think to try spinning the touch-wheel at the 'Outgoing' stage - so I managed to enter "F13" and "F14" into the text boxes. So, I've got my K2 rotating documents with its endless rotaries.

Still, it would be useful to know if there's a way to input these keystrokes without having a physical device to do it - most people don't have a Wacom graphics tablet. And, there might be more commands like this one that use the F15 to F24 keys. I'm kinda surprised this rotate one isn't really known about as far as Photoshop's user guide and shortcuts lists are concerned.

Since he recently put together a post on controlling Photoshop with a MIDI controller, I thought Florian might have something to say about this rotating command. I'm just now trying to learn about Javascripting for Photoshop so that I can map my RGB sliders to three faders on my K2. Wouldn't that be super-neat? I'm hoping using Javascripts would allow you to control the colour sliders without injection or anything, so it'd be more reliable.

florian

2016-08-14 14:13:48

Hi, thanks for the suggestion. Indeed, the upcoming version 1.8.1 features a drop-down list with many special keys for entering them directly into the keystroke field. It'll allow you to add, e.g. all function keys up to F24.

Regards,
Florian

lanz_the_joiner

2016-08-14 17:53:19

florian wrote:Hi, thanks for the suggestion. Indeed, the upcoming version 1.8.1 features a drop-down list with many special keys for entering them directly into the keystroke field. It'll allow you to add, e.g. all function keys up to F24.

Regards,
Florian
Sounds awesome, I look forward to it.

Right now I'm learning the basics of Javascript to find out if I can program three sliders to control the three RBG sliders (or other ways of controlling the colour.) I'm not sure whether you know if this is possible or not using Javascript... or maybe you are mainly interested in purely Bome solutions. Would you be interested in seeing the script if I manage to put something together that works?

florian

2016-08-15 14:26:20

Of course, here we're mainly interested in solutions which use Bome products, but it can't hurt to present alternative solutions. The only thing we're not very keen on is unnecessarily promoting competing products...

lanz_the_joiner

2016-08-19 15:30:08

Hmm, okay. I feel that maybe there is something I don't understand properly.

I was under the impression that JavaScript and AppleScript were basically the same thing. Obviously the Bome team have no issues with people including AppleScript in their MIDI control solutions. So I'm not seeing how JavaScript is seen as a competing product but AppleScript isn't?

Sorry if I'm coming across as obtuse or argumentative. I'm really new to all this. It kinda looks like people using Photoshop on Apple computers have access to a whole world of control that PC users don't, due to the AppleScript support.

Edit: Reading through the manual just now, it looks like the AppleScript outgoing action in Bome MT 1.8 is perfectly capable of directly controlling the colour settings of Photoshop, just like in my dream! Amazing. Although I'm thinking maybe I should start a new thread to discuss these questions.

florian

2016-08-20 13:18:56

Hi, sorry if my formulation was ambiguous. What I meant: we're not keen on suggestions for replacing Bome MIDI Translator with a competitor, if you can do it with MIDI Translator just the same. Everything else is fine. In fact, MT Pro is used a lot with many different technologies, and if you create a workflow with JavaScript with MT Pro that's fantastic! Note, however, that MT Pro does not have built-in support for JS, though there is built-in support for AppleScript.

Regards,
Florian

lanz_the_joiner

2016-08-20 21:20:02

Thanks, that clears it up.

Do you know if there is any reason for there being AppleScript support but not JavaScript? Are there any plans, or is there any possibility for this to be implemented?

Cheers,
Glen

florian

2016-09-08 23:53:31

Hi,
this is definitely an interesting discussion. Sorry for the late reply, it's been 2 busy weeks! Wait, make that months. Or years :)

Some more background: we needed an alternative on OS X for the "injected key strokes" and wound up adding support for AppleScript. That's very easy because the OS provides the AppleScript implementation. MT Pro merely calls the OS with the respective AppleScript. It's useful because AppleScript allows many ways to interact with other programs and the OS. The "injected keystroke" and AppleScript support was requested by a customer who actually payed for the addition of these features.

Now, adding full JavaScript support is technically very different. Just adding JavaScript would not help anything, because it would not give you any functionality for accessing the OS, almost no functionality to communicate with other applications, and, by default, no interaction with MIDI Translator itself. So in order to add at least the latter, we need to put in an enormous amount of development to make JavaScript support in MT Pro useful at all. That why it's not there, yet. And note that there are other scripting languages which other users would prefer for their syntax, or their performance like LUA and Python. For all of them, the problems I stated about JavaScript apply, too.

We do have the plan to add LUA support in MT Pro version 2. We favor it over JavaScript because its scope is more limited and therefore it's easier to control from within MT Pro. The syntax is not so different from JavaScript, so if you know JS, you'll learn LUA very fast.

Having said all that, I still don't understand what you're trying to do with MT Pro where its current functionality is not sufficient. Controlling sliders and RGB seems to me as relatively simple to do with MT Pro, and quite hard (if at all possible) with a JavaScript-only solution. Are you planning on using WebMIDI?

Hope this sheds some light on this issue.

Thanks,
Florian