I’m trying to detect the scroll lock key being pressed as an event, has anyone managed to do this in Xojo?
You’ll need to use a timer and query Keyboard.AsyncKeyDown.
On Windows, you’ll need a declare, since AsyncKeyDown only detects when the user is currently pressing the key (not when it was already pressed and the LED is on).
This one should work:
Declare function GetKeyState lib "User32" (nVirtKey as Integer) as Integer
Var ScrollLockState As Boolean=GetKeyState(145)=1
1 Like
don’t know C#
will try on timer