View Full Version : Mouse and keyboard problem....

12-24-2001, 01:00 PM
Hello, i'm making a fly game, but to retrieve the keys i use "glutKeyboardFunc" and same thing for the mouse.
But those functions have a problem.
For instance, for the mouse, it gives me the window coordinate, so X will stop at 1024 and Y at 768 !!

And for the keyboard, everytime that i have an event in the keyboard function, i go forward (z=z+1 simplified).
The problem is that it isn't cool !

I would like to have a variable which is at 0 when key the key is up and 1 when the key is down in order to modify mi direction everytime i draw.

I can solve that problem using DirectInput but on this case it will only works on windows and i have taken OpenGL for that.

Thanks for help !
(PS : i'm french so...)

12-26-2001, 04:12 AM

in myKeyFunc, set the variable for the key to 1
in myKeyUpFunc, set it to zero.

that's it.

12-26-2001, 05:58 AM
OK thank you !!