Skip to main content
gamedev.net
🔒 Locked

How to do input?

Started by Zeraan 3 replies 250+ views
Original Post
Zeraan
Zeraan
I''m trying to add input for my game, but I don''t know any good way to do it. I''m using DirectInput8 and DirectDraw7 so I can''t use dialog boxes. The input stuff I want to do is for inputting names for high scores. The only one I can think of is to check if a key is pressed, if so, take that character, wait til the key is depressed, then take the next character, and so forth. Is this the only way for DirectInput?
Prototype
Prototype
I''m afraid so.
If you only need keyboard/mouse input I''d suggest to simply use the Win32 GetAsyncKeyState()/GetCursorPos() functions.
But that''s just a personal preference. I dislike writing 50 lines of code just to look if a key was pressed.
wiseachoo
wiseachoo
95% of the code for setting up your input for your game can be reused each time, there is virtually no setup time. It''s worth setting it up with DirectInput8

''Chris
masonium
masonium
If you''re using keyboard input for a high score table, or string input in general, you''d probably be good using the WM_CHAR message. It automatically takes care of the down up stuff and converts shift+a->A or whatever.
If you''re using keyboard/mouse input for your gameplay, try the links in my signature.

''There''s something out there....something stupid...''
''I think I''m going to be ill. Is that a problem for you?''
''[You] overestimate my conscience by assuming that I have one.''
- Daria

DirectInput8 with the Keyboard , DirectInput8 with the Mouse , Using DirectX Audio 8

Topic Locked

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

Sign in to reply to this topic.