problem with keyboard_update

Search this archive.

From: Axel Spamann (Axel_Spamann@gmx.de)
Date: Mon 07 Aug 2000 - 15:54:28 IDT


Hi,

I hope I am not just being plain stupid but really have got a weird-working
keyboard_update(). I have the following method:

inline int SRT_Item::get_reaction()
{
  keyboard_clearstate();
  for(;;)
  {
    usleep(50);
    /*wait for keyboard-event*/
    if (keyboard_update())
    {
      keybuffer = keyboard_getstate();
      /*Some more code*/	
    }
  }
}

it works out perfectly every second time I call it. The other half of the time
keyboard_update() apparently returns 1 after a few (typically 4) recursions
through the loop, although I did not press a key! At least that is what I have
come to believe as the if(keyboard_update()) condition is being met.

Thanks for help!

Axel 
 -- 
Axel Spamann
Universitaet Koeln
Email: Axel@Spamann.de


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST