Keyboard output

For general discussion related FlowStone
Post Reply
IsoJari
Posts: 2
Joined: Wed Dec 12, 2012 9:07 am

Keyboard output

Post by IsoJari »

Is it possible to use keyboard as output device?

example:

Midi in ---> translate midi values to key --> keyboard output to different program.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Keyboard output

Post by tester »

Specify your question.

You can re-assign keyboard keys (to different functions) using some sort of procedure, but this will work within the FS app only. Or I misunderstood the question?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Keyboard output

Post by trogluddite »

Hi IsoJari, welcome to the forum.

There's no simple primitive or module to do what you ask at the moment, but the new Ruby language in FS is able to make calls to external dll's. So, in principle, you could make calls to the Windows win32api.dll to find the controls on the application window and send keypresses to it.
I've used a quite similar procedure in the 'AutoHotKeys' scripting language in the past - it can be a little long-winded, but it means you can target a very specific control in a single window (or even 'child' window), and won't accidentally trigger shortcut keys in other app's because of having the wrong window in focus.
I haven't tried anything like this in FS, and like most people here, it's still early days with Ruby - but a quick search of programming sites like 'StockOverflow' found some examples of the functions you'd need to access. I couldn't find any Ruby specific code, but the principle will be very similar to the ones in this example that the developers posted.
It is a very good idea though - I can imagine a few users having a use for that, so maybe it's the kind of little project that one of the Ruby wizards here might like to have a go at.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply