@world101 said in cardkb GetKey comparison:
getKey seems to return a hex value not decimal. So your if condition = 180, 181, 182, 183 is not being satisfied and the do is never executed. Try converting hex to decimal first, before your if statements. Or you can try comparing on the string values B4, B5, B6, B7 or 0xB4, 0xB5, 0xB6, 0xB7. I don’t have a CardKB to test with, so it might take some trial and error.
I suspected this at the very beginning. I can't put B4 in the numerical field (obviously), but I can input 0xB4 - which immediately gets converted to 180.
When I press the '1' Button on the cardKB, GetKey returns 49 - which equals 0x31, the ASCII Code for '1'.
It feels like the condition isn't true for long enough...
Edit: It seems I just figured it out. I have to set a variable with the getKey function, if I then check the value of the variable, it works...