lmbvarela / cat200-9-2010

Automatically exported from code.google.com/p/cat200-9-2010
0 stars 0 forks source link

Auto-repeating key #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The new updated version (Piano v39) has problem with the keyboard mode.
When I switch to keyboard mode and hold down a key for a while, the sound 
generated is weird, like it loops for a few times.

Original issue reported on code.google.com by seahlin...@gmail.com on 2 Oct 2010 at 12:22

GoogleCodeExporter commented 8 years ago
That is because the keyboard will keep on sending distinct(not continuous) key 
value to the program making the key pressed event loops again and again.
Try ignore repeating key value or just get the first value only.

Original comment by princech...@gmail.com on 2 Oct 2010 at 12:34

GoogleCodeExporter commented 8 years ago
This issue is a common bug in LINUX Operating System. When user holds down a 
key, the program will send KeyPressed() and KeyReleased() events alternatively 
until the user released the key.

Suggestion from Khoo Ka Thoong is implemented. 
Issued solved by implementing timer to ignore repeating KeyReleased().
Repeating KeyPressed() is ignored by getting the time of KeyPressed() event. If 
the difference between KeyPressed() event and the last KeyReleased() event is 
zero, the KeyPressed() event is ignored.

Original comment by seahlin...@gmail.com on 8 Oct 2010 at 2:48