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.

Actually, I don't know exactly why. However, you could use Upper$ and Lower$ to change the cast of the characters:
Const VK_CAPITAL = $14
Const VK_NUMLOCK = $90
Const VK_SCROLL = $91
Const VK_SHIFT = $10

Dim key(3)

key(0) = VK_CAPITAL
key(1) = VK_NUMLOCK
key(2) = VK_SCROLL
key(3) = VK_SHIFT

i = 3
Repeat
	api_keybd_event(key(i),0,0,0) ;key down
	api_keybd_event(key(i),0,2,0) ;key up
	a = 0 : While a = 0 : a = GetKey() : Wend
	;If a > 0 Then Write Chr$(a)
	If a > 0 Then If (api_GetKeyState(key(i)) And $FFFF) Then Write Upper$(Chr$(a)) Else Write Lower$(Chr$(a))
Until KeyHit(1)