Skip to main content
GameDev.net gamedev.net
🔒 Locked

Input

Started by PaulSchwarz Nov 6, 2002 at 3:22 PM 1 replies 200+ views
Original Post
PaulSchwarz
PaulSchwarz
I have a problem. I''ve written a small program using DirectInput 8. I''ve compiled it and pressed randomly some keys on the keyboard so as to check if the program was working correctly. Unfortunatelly, despite programming some OnAnyKeyPress events the program seemed not to notice that the key had been pressed when I was pressing arrow keys. But when I was pressing some other keys, everything worked smoothly. Simply, I can''t find out in which part of the program''s code I made a mistake, so I cannot provide you any more information about my problem. Yet, if you ever had something similar, post here your message, pls.
kressilac
kressilac
Are you using buffered input? If not, this is the typical problem with Direct Input when not using buffered input. It is possible that you''re application will miss a click or a keypress while it is doing something else, say rendering.

When using buffered input, (GetDeviceData() instead of GetDeviceState()) Direct Input captures everything and holds it in a buffer waiting for you to process it. Buffered data takes a bit more setup to get working properly, but simplifies keyboard management. It makes mouse management a bit more accurate though more complex than non-buffered input.

I''d suggest getting buffered input up and running and if you still have the same problem send me an email. I''ll see if I can help you get it up and running.



Derek Licciardi (Kressilac)
Elysian Productions Inc.

Derek Licciardi (Kressilac)Elysian Productions Inc.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.