[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to handle keyboard input

Hey all.

Doing a game with OpenGL, using glutKeyboardFunc to get some
keypresses. However, this is not good:

a) Having to handle both KeyboardFunc and SpecialFunc, and *Up* funcs is 
   tiresome, and I have no garantee that a keydown will eventually
   generate a key up.
b) I can't handle multiple pressed keys.

I know absolutly nothing about coding in X. So, what is the preferred way
to handle keyboard/mouse/joystick input?

I have an idea that somehow these events should be handled by the same
logic, ie, I have one "stream" of events. Maybe I need to sample the mouse
and joystick regulary, but I don't mind.

Suggestions appreciated.


Mads Bondo Dydensborg.                               madsdyd@challenge.dk
Faced with the prospect of rereading this book, I would rather have my brains
ripped out by a plastic fork
                 - Charles Cooper, ZD net, in review of B@TSOT by Bill Gates.

To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: linuxgames-help@sunsite.auc.dk