PDA

View Full Version : Keyboard listener



Dogcow
10-25-2002, 07:21 AM
The only camera tutorial I've been able to find uses GetKeyState, which unless I'm mistaken is part of visual C++. I intended to have my display loop call a checkMovement method which in turn would use GetKeyState to see if a key is pressed. If one of the movement keys is being pressed, the checkMovement method will call one of the camera methods which in turn would make the necessary calculations then apply the changes to gluLookAt.

Is there another keyboard listener that I can use that would fit this plan well or do I need to use some other technique? Suggestions appreciated.

-Dogcow "moof!"
Visit The Underground (http://theunderground.eon.com.au)

nexusone
10-25-2002, 07:39 AM
Have you looked into using the SDL library?
It has a good keyboard input routines.
Also is crossplatform.
www.libsdl.org (http://www.libsdl.org)

*Aaron*
10-25-2002, 08:27 AM
Nah, use FLTK instead. It's also cross-platform, and it's LGPL. www.fltk.org (http://www.fltk.org)


... GetKeyState, which unless I'm mistaken is part of visual C++.This is a Win32 API function, not a VC++ fuction. There's a difference: VC++ is a compiler, Win32 API is an API.

dabeav
10-25-2002, 09:58 AM
I simply use glut, Some say it is sluggish. But when using it to set a bool table, then using the bool table to issue commands to the function list. It seems to work GREAT, and it is compleately open.