Read NUMLOCK / CAPSLOCK from keyboard controller

Blitz3D Forums/Blitz3D Programming/Read NUMLOCK / CAPSLOCK from keyboard controller

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You mean, checking their status ? The GetKeyState() function in user32.dll should be able to do that:
;------------------------
;.lib "user32.dll" 
;
;api_GetKeyState%(key%):"GetKeyState"
;------------------------

Const VK_CAPITAL = $14
Const VK_INSERT = $2D
Const VK_NUMLOCK = $90
Const VK_SCROLL = $91

Repeat
	
	Cls
	Text 0,  0, "CAPS:" + ((api_GetKeyState(VK_CAPITAL) And $FFFF) <> 0)
	Text 0, 20, "INS: " + ((api_GetKeyState(VK_INSERT) And $FFFF) <> 0)
	Text 0, 40, "NUM: " + ((api_GetKeyState(VK_NUMLOCK) And $FFFF) <> 0)
	Text 0, 60, "SCRL:" + ((api_GetKeyState(VK_SCROLL) And $FFFF) <> 0)
	Flip
	
Until KeyHit(1)

End

For changing them, I thing you could try using the Keybd_Event command.