How can I use keyboard input in my opengl game engine?

How can I read the keyboard input from my Opengl Game Engine under Linux??? I don’t want to use SDL. There is any library??? I am using Mandrake Linux 6.2.

Well, SDL is a library, but since you don’t want to use it, your options are (this list is probably not exhaustive):

[ul][li] X11 keyboard/event stuff (see your local X11 documentation for that)[*] GLUT keyboard stuff (glutKeyboardFunc, glutSpecialFunc, glutKeyboardUpFunc, glutSpecialUpFunc)[/ul][/li]
Have fun.

And what about the X11 extensions? there is any extension that let me use the keyboard??? Maybe X Input extension??? What is exactly this extension used for??

I believe X Input extension is for things like exotice mice and joysticks (but double check your documentation to be sure).

When I say “Use X11”, I mean the usual event handling sort of stuff.

Well, finally I used X11 input events to handle my keyboard functions, but… There is any library like Direct Input in Win32 which allows me direct access to the hardware, and avoid the X11 **** events??? I don’t want to use glut,SDL nor SVAlib.

Originally posted by Sansus:
Well, finally I used X11 input events to handle my keyboard functions, but… There is any library like Direct Input in Win32 which allows me direct access to the hardware, and avoid the X11 **** events??? I don’t want to use glut,SDL nor SVAlib.

Uh… yeah. There are three: glut, SDL and SVGAlib.

Cheers.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.