bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

separate key_press and key_release events


From: Da-Breegster
Subject: separate key_press and key_release events
Date: Fri, 25 Jul 2008 13:59:13 -0500
User-agent: elmo/1.3.0

My ASCII art ncurses game is proceeding with few bumps, but I've hit another 
problem. In
SDL, a key event has an explicit type of being pressed or released. This allows 
for
characters in games to move right (by holding right), jump (by tapping up), and 
continue
moving right (because the right arrow key is still depressed). There seems to 
be no
equivalent in ncurses; getch() returns a simple keypress. Pressing and holding 
a key fires
repeated events correctly, but if the sequence is interrupted with a tap of the 
up key, no
more right_arrow keys come in. The player has to release and repress the right 
key.

1) Is this caused by my terminal emulator (urxvt) or X? It seems to occur 
anywhere.
2) Is ncurses designed like this for a reason and is there a way to "correct" 
the above
behavior?

I know I could read off /dev/input and parse it and roll my own keyboard 
handling, but
I'd prefer not to for this purpose.

Thanks,
~Breeg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]