What library should I use for input?

Started by
7 comments, last by Nytehauq 18 years ago
What library should I use for input? I'm trying to stay relatively platform independent, and I don't want to use anything Microsoft. I'm looking for a simple library for handling input that won't interfere with other parts of the program. I looked at SDL and Allegro, but I can't get them to start up with just input - they want to do graphics and everything too. Any ideas?
::FDL::The world will never be the same
Advertisement
You could check out my OIS lib (check my sig). It is currently only ported to Linux (under X11) and Win32 (via DirectInput). A MacOSX port has been in work for a little while. Also, plans for other platforms (and consoles) are in the works.
Yeah, I understand your frustration too. I've been looking for one too that doesn't want to do rendering or anything else and is free to use commercially. After looking for platform indy solutions (didn't find any), I then tried WM_KEY**** and WM_INPUT messages (the fact that you don't get them on a per-frame basis complicated things and wasn't as neat as I liked), then tried GetAsyncKeyState (after a few calls, successive calls started reducing my frame rate exponentially), and then ended up going back to DirectInput (the most evil, but it really does work the best).
Quote:Original post by yadango
Yeah, I understand your frustration too. I've been looking for one too that doesn't want to do rendering or anything else and is free to use commercially. After looking for platform indy solutions (didn't find any), I then tried WM_KEY**** and WM_INPUT messages (the fact that you don't get them on a per-frame basis complicated things and wasn't as neat as I liked), then tried GetAsyncKeyState (after a few calls, successive calls started reducing my frame rate exponentially), and then ended up going back to DirectInput (the most evil, but it really does work the best).


Yeah, I figure I might as well use DirectInput on microsoft platforms and develop other implementations on a platform by platform basis. It'd be great to use other libraries if they were actually suited to your needs ;(
::FDL::The world will never be the same
Quote:Original post by Nytehauq
Quote:Original post by yadango
Yeah, I understand your frustration too. I've been looking for one too that doesn't want to do rendering or anything else and is free to use commercially. After looking for platform indy solutions (didn't find any), I then tried WM_KEY**** and WM_INPUT messages (the fact that you don't get them on a per-frame basis complicated things and wasn't as neat as I liked), then tried GetAsyncKeyState (after a few calls, successive calls started reducing my frame rate exponentially), and then ended up going back to DirectInput (the most evil, but it really does work the best).


Yeah, I figure I might as well use DirectInput on microsoft platforms and develop other implementations on a platform by platform basis. It'd be great to use other libraries if they were actually suited to your needs ;(


Um? Just curious.. Did you read my post? I am not trying to be pushy or anything.. It's just that my lib already uses DirectInput under the hood, and provides a cross platform C++ API for the Keyboard/Mouse/Joysticks. Plus, my lib is zlib, so use it, mod it, whatever, no strings attached ;)

But, do as you will, spend months reinventing the wheel if you want :D
Quote:Original post by pjcast
Quote:Original post by Nytehauq
Quote:Original post by yadango
Yeah, I understand your frustration too. I've been looking for one too that doesn't want to do rendering or anything else and is free to use commercially. After looking for platform indy solutions (didn't find any), I then tried WM_KEY**** and WM_INPUT messages (the fact that you don't get them on a per-frame basis complicated things and wasn't as neat as I liked), then tried GetAsyncKeyState (after a few calls, successive calls started reducing my frame rate exponentially), and then ended up going back to DirectInput (the most evil, but it really does work the best).


Yeah, I figure I might as well use DirectInput on microsoft platforms and develop other implementations on a platform by platform basis. It'd be great to use other libraries if they were actually suited to your needs ;(


Um? Just curious.. Did you read my post? I am not trying to be pushy or anything.. It's just that my lib already uses DirectInput under the hood, and provides a cross platform C++ API for the Keyboard/Mouse/Joysticks. Plus, my lib is zlib, so use it, mod it, whatever, no strings attached ;)

But, do as you will, spend months reinventing the wheel if you want :D


Oh, sorry, I did read your post ;), just got sidetracked.

I figure I'll write my own library though, I don't really like to use other libraries without at least knowing how they work and being able to do everything without them anyway.
::FDL::The world will never be the same
His library is open source, so there's nothing stopping you from being able to learn and understand his code for you to modify for your own needs. I mean, wasn't this your original question?

Quote:What library should I use for input? I'm trying to stay relatively platform independent, and I don't want to use anything Microsoft. I'm looking for a simple library for handling input that won't interfere with other parts of the program. I looked at SDL and Allegro, but I can't get them to start up with just input - they want to do graphics and everything too. Any ideas?


I just find it odd that someone posts something that exactly matches what you said you wanted only to say 'nah' a few posts later. Your choice though.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

http://www.robthebloke.org/code_dump/Joypad.zip

C++ source to wrap Direct input and the linux joystick lib.
Thanks for the suggestions.

However, having read superpig's enginuity series thoroughly, I've decided to settle on using SDL for all the mundane tasks that I wanted to keep free of it, and also use it for input. I guess I won't be reinventing the wheel ;)
::FDL::The world will never be the same

This topic is closed to new replies.

Advertisement