Jump to content
  • Advertisement
Sign in to follow this  
kburkhart84

Need to update my input code

This topic is 4226 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Thanks in advance. I want to update/redo the codebase I use for input. Currently, it works fine and uses DInput8. Joysticks work and I have no problems, but I want to make it more robust and possibly have usage of a queue for keystrokes incase I ever need them. Also, I'm wanting to ditch DInput8 since supposedly M$ itself is recommending using something else. I don't mind making my own code, but if something already exists that works for my needs, that will be fine. I'll be using windows vista so whatever it is needs to work for vista and doesn't need to be cross-platform. Anyone have any suggestions to already working code or a good API I could write my own classes around???

Share this post


Link to post
Share on other sites
Advertisement
The Windows APIs provide simple and direct access to mouse and keyboard events. I dare say there are existing libraries out there that will simplify the process somewhat, but there's only so far you can wrap something before the packaging just gets in the way.

Windows messages (WM_KEYDOWN, WM_KEYUP, WM_CHAR) provide buffered keyboard access. GetAsyncKeyState provides immediate-mode access. Similarly for WM_MOUSEMOVE, GetCursorPos. If you need more power, WM_INPUT lets you have lower-level access in exchange for some maintainability. Throw in your language's standard containers (std::queue springs to mind in C++) and you have all the buffering you could ever need.

Admiral

Share this post


Link to post
Share on other sites
Quote:
Original post by TheAdmiral
The Windows APIs provide simple and direct access to mouse and keyboard events. I dare say there are existing libraries out there that will simplify the process somewhat, but there's only so far you can wrap something before the packaging just gets in the way.

Windows messages (WM_KEYDOWN, WM_KEYUP, WM_CHAR) provide buffered keyboard access. GetAsyncKeyState provides immediate-mode access. Similarly for WM_MOUSEMOVE, GetCursorPos. If you need more power, WM_INPUT lets you have lower-level access in exchange for some maintainability. Throw in your language's standard containers (std::queue springs to mind in C++) and you have all the buffering you could ever need.

Admiral


I'd possibly be interested in the wrappers if anyone knows. I'd rather try a couple and find a good one than rewrite my own. Also, my original DInput code if I'm not mistaken falls back to windows events anyway. I think I saw somewhere that DInput used the Windows API anyway, so there wouldn't be much different from using what I currently have, unless I'm misinformed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!