Isolating keypresses

For general discussion related FlowStone
Post Reply
unkargherth
Posts: 29
Joined: Fri Apr 08, 2005 9:46 pm

Isolating keypresses

Post 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 ?
Free your memory, .. with a free(). Like a pointer
Cast a pointer into an integer and it becomes the integer...
Cast a pointer into a struct and it becomes the struct...
A pointer can overflow... or can crash...
Be a pointer my friend
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Isolating keypresses

Post 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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
infuzion
Posts: 109
Joined: Tue Jul 13, 2010 11:55 am
Location: Kansas City, USA, Earth, Sol

Re: Isolating keypresses

Post 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.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Isolating keypresses

Post 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:
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