|
Atari coding BBS
how to read key codes? |
Posted by: mikro
|
Aug,26.2006-22:38
|
hello,
i went to the interesting problem. some game i wish to port wants keyboard code (this is ok) and the status of the key itself (pressed/released). I went through whole compendium and only thing i found is to use classic gemdos call (cnecin iirc) which offers no key status or to hang on ikbdsys vector (KBDVECS structure from Kbdvbase() call) which works great but the drawback is the whole game has to run in supervisor. (no idea why, when i assign new ikbdsys function vector and start the program, after key press i've got "stack overflow" error).
any ideas how to do it in the clean way? it would be pity to use SV, whole game is in user-space and memory protection friendly...
btw do you have an idea, why cnecin() (after checking pending bytes to receive) returns two or even three (!) scancodes in one go for some keys? (Fxx, arrows, ...). The first scancode is always ESC key and then it varies. It's true i use eiffel but... when i read 0xfffffc02 directly (the method above) i've got one (and correct) number.
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|