View Full Version : Strange behavior in GLUT Key Up/down

01-18-2004, 10:05 PM
Hi gang,

I wish to detect key-press / release for as many simultaneous keys as possible at a given instant of time only using GLUT api.

I have used c++ code that looks like :

/*usual code replaced by ... for simplicity*/


void keyPressed(unsigned char key, int x, int y) {cout << "pressed " << key << endl;}

void keyReleased(unsigned char key, int x, int y) {cout << "released " << key << endl;}


int main(int argc, char **argv){




Tried this on win2K PC with VC++6.0 GLUT API ver 3. This works as expected as long as I press keys on a single row of the keyboard.

Example: (simultaneoulsy )a,s,d,f,g,h,j,k,l,;,' pressed and released in any order are detected properly.
But, pressing (simultaneoulsy ) a,s,z,d 'z' goes undetected.

And lots of such similar combinations where things can go wrong exist.

Any ideas?

Thanks for reading till this point http://www.opengl.org/discussion_boards/ubb/smile.gif

Tom Nuydens
01-18-2004, 10:38 PM
The toolkits forum is more appropriate for this post...

-- Tom