Key Capture

BlitzPlus Forums/BlitzPlus Programming/Key Capture

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.

Ok, the user32.dll offers "GetKeyboardState(buffer)"
Your supposed to pass it a 256 byte buffer that it fills with the states of all 256 virtualKeys. But no matter what I hit the returned data reads all 0's. I think I may be passing the bank to it in the wrong way. Any help?

bank = CreateBank(256)
 Print "Starting scan..."
Repeat
x = api_GetKeyboardState(bank) 
For I = 0 To 255
v = PeekByte(bank, i)
If  v <> 0 Then Print PeekByte(bank, i)
Next
Forever