Is there a way to intercept the keypress event on a control?
Something like keydown, keyup
Printable View
Is there a way to intercept the keypress event on a control?
Something like keydown, keyup
I think keypresses are handled by the Unity engine itself and then passed to FG. So I think you'd need to intercept them from outside FG - but I'm no expert in this.
Look at windowcontrol.onClickDown/onClickRelease. There are tons of examples in the built-in rulesets.
If you just need a button, you can look at buttoncontrol.onButtonPressed too.
Regards,
JPG
There are functions for IsControlPressed and onControl and the same for Shift and Alt
https://fantasygroundsunity.atlassia...96644619/Input
That might be the limit.
What I'd like to do is change a selection in a windowlist on pressing arrows on the keyboard. From what I see in
the Input API there are events only for pressing the Alt, Control and Shift keys.
I think they can be used with a statement likeHow do I intercept the arrow keys?Code:Input.addEventHandler("onAlt", myFunction);
Im pretty sure you cant.
Only text controls support any sort of arrow navigation events. It really hasn't come up as a needed capability more than once or twice in the last 12 years. For text controls, the events are onNavigateLeft, onNavigateRight, onNavigateUp, onNavigateDown; and they will only trigger when on the boundary of the field (i.e. arrow left when in zero character position; arrow right in last character position; arrow down when on last line; arrow up when on first line).
Regards,
JPG