keycodes wrong
BlitzMax Forums/BlitzMax Programming/keycodes wrong
| ||
is it just me or are many keycodes wrong? for instance "y" should be 89 while its 121, "a" should be 65 while its 97 etc etc etc... Graphics 300,300,0 Local a Local olda Repeat Cls a=GetChar() If a<>0 olda=a DrawText(olda),30,30 Flip Until KeyDown(key_escape) |
| ||
GetChar() returns ascii codes, eg:Print Asc("y") Print Asc("a") Print Asc("Y") Print Asc("A") |
| ||
You mean that "character code" is different from "key code?" hmm... |
| ||
. |
| ||
You mean that "character code" is different from "key code?" hmm... Yes. Keycodes refer (more or less) to a keys physical location on a keyboard (or more precisely, the key with a particular 'glyph' on it), and doesn't take shift/ctrl etc into account. Character codes on the other hand are affected by shift/ctrl etc and can be the result of multiple keystrokes. |
| ||
for instance "y" should be 89 while its 121, "a" should be 65 while its 97 etc etc etc... The ascii value for "A" is different from "a". "A" is 65 while "a" is 97. "A-Z" is 65-90, "a-z" is 97-122. The blitz keycodes just return the lowercase value. |