Jump to content
  • Advertisement
Sign in to follow this  
marty78

Implementing an text input handler

This topic is 4881 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

hey all; i was wondering if some of you could guide me a bit when it comes to implementing input handling. I have an application up and running, and sate machines that indicate the console state. What exactly are you all using for your input handling? I am trying to find a solution apart from DirectInput, SDL and the standard windows message handling system. Are there any alternatives that are relatively simple to implement? Do any of you know good libraries to do so? I would really appreciate feedback :) thanks guys, marty78

Share this post


Link to post
Share on other sites
Advertisement
Marty,

AS far as input goes, you have essentially three choices.

1. Win32 API (windows) input messages. This is probably the most convenient to use and gives you all the input power you need. As well, it allows you to utilize user configured keyboard and mouse settings for things such as scroll speed, etc...

2. DirectX or other hardware accelerated device drivers. DirectInput polls the hardware (keyboard, mouse, joy pad, etc...) directly and thus can often mean quicker response to user input. With that in mind, you do not have access to any of the user configured system settings as mentioned above. As well, DirectInput can be a little more cumbersome to use than the Win32 API GetCursorPos() type functions.

3. Wrappers. Pretty much everything else out there is a wrapper either around the Win32 API or DirectInput. These wrappers can sometimes be easier to use but may not provide the most intimate connection with hardware.

Ultimately, you just need to determine which you prefer most. I've found from personal experience that just using the win32 api input functions, etc... are usually all that is necessary. Use DirectInput if you don’t mind a little extra effort for a little faster response times. And finally, use SDL, etc...if you like the convenience of an easy to use interface.

Share this post


Link to post
Share on other sites
Yeah implement a wrapper than handels all the key inputs...

Then perhaps use some automata theory crap to organize the inputs in real time...


Share this post


Link to post
Share on other sites
Indeed. You're likely going to just abstract out the keyboard input anyways so to impliment keybinding, and make it much easier to define the game's reaction to input. Making the intermediary step to bridge win32-api, DInput, SDL, or just plain read() into the abstraction is pretty simple and straightforward at that point. Plus, you can then switch input types pretty easily, since all of your game deals with the abstraction.

Share this post


Link to post
Share on other sites
Awsome, thats exactly what i was looking for. thanks a bunch for the constructive replies guys

:)
marty78

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!