Set or Unset the keyboard numlock and read its stateTag(s): Win API
This code will toggle the keyboard NUM LOCK state.
OleObject wsh
Integer li_rc
wsh = CREATE OleObject
li_rc = wsh.ConnectToNewObject( "WScript.Shell" )
wsh.SendKeys("{NUMLOCK}")
To read the NUM LOCK state
[local function declaration]
FUNCTION int GetKeyState(int keystatus) LIBRARY "user32.dll"
[powerscript]
int li_keystate
li_keystate = GetKeyState(144)
IF li_keystate = 1 THEN
MessageBox("", "NUMLOCK on")
ELSEIF li_keystate = 0 THEN
MessageBox("", "NUMLOCK off")
END IF
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com