PDA

View Full Version : GLUT auto-repeat



07-03-2001, 10:01 AM
We are writing an application where we need to use the keyboard callback with auto-repeat to perform a series of calculations until the user releases the key. The problem is, when the calculations take longer than a key's auto-repeat rate,
the calculations continue after the user has released the key.

I have tried multi-threading, different uses of the the Keyboard and the KeyboardUp with while loops and the glutIgnoreKeyRepeat function, and nothing seems to work.

Any ideas would be appreciated.

Bryan

zed
07-03-2001, 04:49 PM
disable key repeat (theres a glut command) and just store the info about keys like so

wrong syntax
Glut_key_pressed( )
{
switch (key)
case 'a':
key{KEY_A] = true;
}

Glut_key_releaseded( )
{
switch (key)
case 'a':
key{KEY_A] = false;
}

main_loop()
{
if ( key[KEY_A] ) do something
}