PDA

View Full Version : key up event, how?



hellox
04-20-2003, 09:01 AM
Hi, can anyone tell me how to manage the Key_up event? iam using the glutKeyboardFunc(&keyPressed); to control they down event but i have no idea how to make the up.

Thanks for any help
=)

shinpaughp
04-20-2003, 09:13 AM
glutKeyboardUpFunc

nexusone
04-20-2003, 04:14 PM
There is not function for keystate other then pressed.
Just one of the limitation of using glut, you may need to look at using something like SDL instead of GLUT.



Originally posted by hellox:
Hi, can anyone tell me how to manage the Key_up event? iam using the glutKeyboardFunc(&keyPressed); to control they down event but i have no idea how to make the up.

Thanks for any help
=)

shinpaughp
04-20-2003, 05:38 PM
nexusone:
I think you need to update your GLUT files and your documentation files. http://www.opengl.org/discussion_boards/ubb/smile.gif

glutKeyboardUpFunc does exist, and should be valid for his use. I tested it and it does work - held down a key for a while... let it go... glutKeyboardUpFunc callback function sprang into action. This is in version GLUT 3.7 header




#if (GLUT_API_VERSION >= 4 | | GLUT_XLIB_IMPLEMENTATION >= 13)//defined as 3 and 15 respectively
GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
#endif




[This message has been edited by shinpaughp (edited 04-20-2003).]

hellox
04-21-2003, 03:59 AM
Thanks to all =D