views:

72

answers:

3

looking for a library for accessing the keyboards functions, key states, etc. the language I'm planning on using is C++

+1  A: 

There is no such possibility in C++ standard. It depends on platform you are going to support. The only portable way is to use portable library.

You could try Qt library, which is good looking and pretty convenient. For console application you could try ncurses.

Kirill V. Lyadvinsky
PDCurses works on win32 and X11 (see http://en.wikipedia.org/wiki/Curses_%28programming_library%29)
Tobias Langner
A: 

If you are using Windows than you'll be using various window messages like WM_KEYDOWN, WM_KEYUP, WM_SYSCOMMAND. Between those you should be able to whatever you need to do.

Igor Zevaka
A: 

Try SDL: http://www.libsdl.org. It's cross-platform, and you don't have to use the graphics portion of the library if you don't need it. Also, it gives you access to joysticks, if you want to have some fun ;)

Matt Fichman
i tried and its not working. simply doesn't see that a key was pressed
TheFuzz
Look at the tutorial here: http://gpwiki.org/index.php/SDL:Tutorials:Keyboard_Input_using_an_Event_Loop
Matt Fichman