From: Ben S. <bs...@vr...> - 2002-01-25 22:20:18
|
you'll also want to call glutIgnoreKeyRepeat( 1 ) before entering the glutMainLoop(). This will tell glut not to repeatedly call your KeyboardFunc and just do the edge triggering that kevin described. for a bigger example of using glut's keyboard and mouse input, check out the simple glut app posted by kevin. be warned that it sets up opengl for 3D drawing and not 2D as we showed at the last meeting. http://cvs.sf.net/cgi-bin/viewcvs.cgi/*checkout*/isugamedev/examples/simple.glut/ cheers, ----- Ben Scott President ISU Game Developers Club Treasurer ISU Ballroom Dance Company bs...@ia... On Fri, 25 Jan 2002, Kevin Meinert wrote: > > how is it "piss poor"? I guess I don't know what sticky key means. As I > remember you can configure GLUT to have an event triggered for KEY_DOWN, > and one for KEY_UP. -or- you can configure it for the normal crappy > windows (might be default) way where you hold donw the key, and it repeats > (dending lots of events)... > > > anyway, check out the glutKeyboardFunc and glutKeyboardUpFunc. one is for > down events, and one is for up events. in GLUT 3.7 it handles the edge > triggering as I mentioned before. It really isn't bad. > > The callback being called for each individual key is reasonable since I'm > not even sure the hardware can detect multiple hits at once (it's serial > right?)... > > I would use the two keyboard funcs as collectors. then in your draw loop > act on what buttons are pressed (by polling the data collected every > frame)... > > this has worked very well for me in the past, much better than piss-poor > IMHO... > > > Kevin > > > On Fri, 25 Jan 2002, Andres Reinot wrote: > > > I have noticed, that the keyboard input in GLUT is piss-poor. It only catches one key at a time, and has that sticky-key thing that windows and text editors like to do. Is there a way to fix this, or is there a better input handler we could be using? > > > > p.s. I'll try not to flood so much I guess, a message board would solve this nicely. Until you get the sf.net one going, everyone's welcome to use mine: http://www.reinot.com/ should have a link to it on the main page (the link itself is a CGI mess) > > > > |