perfect keyboard handler
Does anybody have a perfect keyboard handler for DJGPP?
I have heard that the keyboard sends the scan code of a key when it is pressed and when it is released. Isn''t is possible then to just keep track of what scan codes have been recieved and know when keys are currently down/up?
I have not been able to find a keyboard handler anywhere like this. They either mess up when certain keys are pressed at the same time, or "forget" that a key is down when you press another one.
ie. when you press CTRL and LEFT_ARROW it only acknowledges LEFT_ARROW
ie. you''re holding down LEFT_ARROW, but when you press CTRL the program assumes you are no longer holding down LEFT_ARROW even though you are.
If anybody has a perfect keyboard handler (source, url, etc) please let me know. My game is being created using DJGPP in protected mode.
http://fakemind.com
Ever heard of Allegro? It''s a game programming library for DJGPP and it is great. There is everything you need for making games...sound, graphics, 3D stuff and input handling (keyboard, mouse and joystick).
-René
-René
yes I have heard of allegro, but I am not going to use it for any part of my game. I am not creating my game only for other people to enjoy, but because I want to know how to. Creating all the graphic functions, AI, etc is knowledge I want to obtain in this project. (no "black boxes").
Thank you for the post, but I really want to know how all the code in my game works. If you have the source for the mouse/keyboard handler (and the keyboard handler is perfect) that would be awesome. =)
Thank you for the post, but I really want to know how all the code in my game works. If you have the source for the mouse/keyboard handler (and the keyboard handler is perfect) that would be awesome. =)
http://fakemind.com
I have the source to a ASM/C keyboard handler that you could look over to write your own.
I used that source to write my own protected-mode key handler in ASM, but be aware, there ARE a few issues that cause what you''re talking about.
Every keyboard (that I''ve seen, at least) have certain key combos that cause "key jams". In a key jam, the keyboard will not send down/up info for the next key in the combo. For example, on a keyboard in the other room, if you push left or right alone it works fine. If, however, you hold down the shift key while pressing left and right, it turns out that the left key is keyjammed by shift, and does not register. It''s nothing to do with code, and everthing to do with hardware. It varies from keyboard to keyboard, some keyjam on really common keycombos (like I just stated), others are pretty good.
- Remnant
- (Steve Schmitt)
- Remnant- (Steve Schmitt)
Sorry Jeremiah, i dont have a keyboard handler. But i suggest you download the Allegro library and take a look at the source code. You can really learn alot from it.
I dont think a perfect keyboard handler exists. Even the windows keyboard handler causes "key jam" from time to time. Sometimes windows acts like the CTRL key is down even when it isnt. Pretty annoying when it happens ...
-René
I dont think a perfect keyboard handler exists. Even the windows keyboard handler causes "key jam" from time to time. Sometimes windows acts like the CTRL key is down even when it isnt. Pretty annoying when it happens ...
-René
The meaning of each scan code is not ubiquitous either.
code 1123 this keyboard may not represent the same key(s) on that keyboard.
code 1123 this keyboard may not represent the same key(s) on that keyboard.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement