PDA

View Full Version : Can You Capture Key Presses?



UrsaTeddy
June 4th, 2020, 10:30
Greetings,

So I have controls using the onWheel event handler, however I was wondering if I could also capture the arrow keys to do the same (up/down).

damned
June 4th, 2020, 11:11
I think only ctrl, alt, shift

UrsaTeddy
June 4th, 2020, 11:13
I think only ctrl, alt, shift

Do you mean I can at least capture those keys? Or is it the inbuilt modifiers for the hotbar?

damned
June 4th, 2020, 11:23
https://www.fantasygrounds.com/refdoc/Input.xcp

UrsaTeddy
June 4th, 2020, 11:26
https://www.fantasygrounds.com/refdoc/Input.xcp

Okay so it is more simple than I hoped. You can just capture the state of the modifier keys, but cannot check the key pressed in combination with it.

At least I could have said if Shift pressed and Arrow pressed then do something.

The scrollwheel functionality is clunky with my mouse which is overly sensitive in FGU.

As always, thank you.

Ikael
June 4th, 2020, 16:02
See https://www.fantasygrounds.com/refdoc/textbasecontrol.xcp#onChar.

You can use them in stringcontrols and fields.

UrsaTeddy
June 5th, 2020, 02:19
See https://www.fantasygrounds.com/refdoc/textbasecontrol.xcp#onChar.

You can use them in stringcontrols and fields.

Fantastic! That works.

Thanks again to all.