| Posted: 04:01pm 24 Jan 2025 |
|
|
|
@John I think this is a better attempt to show the different return values for different keyboards.
'* Keydown-view to show all keydown codes '* From manual: '* KEYDOWN(0) = number of keys being pressed '* KEYDOWN(1)-(6)= decimal ASCII value of the USB keyboard key '* KEYDOWN(7) = will give any modifier keys that are pressed '* lalt = 1, lctrl = 2, lgui = 4, lshift = 8, '* ralt = 16,rctrl = 32, rgui = 64, rshift = 128, '* Last column: KEYDOWN(8)=status of the lock keys '* caps_lock = 1, num_lock = 2, scroll_lock = 4 '************************************************** MODE 1 CLS Dim key$ Dim integer i,pp,FW=MM.Info(fontwidth) CLS Print "Keydown view. Press a key to check! EXIT with CTRL + <C>" Print Do Do :Key$=Inkey$:Loop While Key$="" If key$<" " Then key$="" pp=9 Print "ASCII: ";key$;@(pp*FW); For i= 0 To 7 Inc pp,9-(i<1)*2 Color RGB(white),255<<7 Or 255 * Not(i Mod 2) Print "K(";Str$(i,1);")"; Select Case i Case 0 Print KeyDown(i);" "; Case <7 Print Str$(KeyDown(i),4);" "; Case 7 Print Str$(KeyDown(i),4); Color RGB(white),0 Print KeyDown(8); End Select Print @(pp*fw); Next Print Loop End
 Kind regards Michael |