Page 1 of 1

Isolating keypresses

Posted: Fri Nov 23, 2012 5:36 pm
by unkargherth
hi all
It's possible to "capture" the keyboard same way we capture the mouse?

Details:

Trying something with the isKeyPressed primitive I found that if the key matches any of the shortcuts of FS3 ( you know, "z" for trigger button, "f" for float"), the keypress is correctly detected but it also tries to get the corresponding item from toolbox. NOt tested but I suspect same happend whith the isKeyPress ruby call

An once I started to ask. Why that doesn't happen when you use the PC Keyboard Midi In ?

Is there anyway to forbid that ?

Re: Isolating keypresses

Posted: Fri Nov 23, 2012 7:32 pm
by trogluddite
Yes, this has long been the behaviour in SM too.
Turning on MIDI keys works differently because it is actually receiving the keypress events direct from Windows. The isKeyPressed doesn't receive these events, it just polls the current state only when you ask it to. As you suspect, the Ruby call is the same.
It would be great to have a way to receive these events properly - and the mouse-wheel uses a similar events system, so maybe that could be added too. You'd need on/off toggles in the menus for them too, because you probably wouldn't want them switched on all the time while editing.

Re: Isolating keypresses

Posted: Sun Nov 25, 2012 4:13 am
by infuzion
trogluddite wrote:You'd need on/off toggles in the menus for them too, because you probably wouldn't want them switched on all the time while editing.
[Enter] key works for toggling the Keyboard-MIDI input.

Re: Isolating keypresses

Posted: Sun Nov 25, 2012 1:01 pm
by trogluddite
infuzion wrote:[Enter] key works for toggling the Keyboard-MIDI input.

He he, all this time using SM, and I never noticed that! :oops: