keycode confusion

Hi
I am using a US keyboard

I a timer a have (part of it as example)
If Keyboard.AsyncKeyDown(00) then
NotePlayer1.Instrument = 1
NotePlayer1.PlayNote(60, 100)
ElseIf Keyboard.AsyncKeyDown(26) then
NotePlayer1.Instrument = 1
NotePlayer1.PlayNote(60, 100)
ElseIf Keyboard.AsyncKeyDown(28) then
NotePlayer1.Instrument = 1
NotePlayer1.PlayNote(60, 100)
Else
//
end if

When I press “a” wich is keycode “00” if plays the middle C but
nothing happens when “j” and “k” is pressed according to the Xojo reference it is keycodes “26” and “28”
Pressing keys one by one I found that “7” and “8” will play the note.

Is it something I am doing or the table is wrong?
Where are these codes come from?
How can I print the keycode and the character in a textfield1 when I press a key?

Thanks for any help

I believe those codes are actually hex values. So hex 26 represents 2*16+6 = decimal 38. But you don’t have to do the math, just add &h before the value…

ElseIf Keyboard.AsyncKeyDown(&h26) then

Pressing “a” works because hex 0 = decimal 0.

Thanks Will,
Time difference, had to get some sleep.
Putting &h in front works correctly for all keys.
I am having trouble finding in the Language Reference how get the key press so as to output a message
MsgBox("you have pressed “key”)
Could I get a hint.

Use a timer, as you already have done.

Thanks Tim

The inverse of whatever keys you detect are being held down.