Chrisshia <
angus...@gmail.com> writes:
> On Saturday, March 30, 2013 8:40:53 AM UTC-4, Chrisshia wrote:
>>
>
> i just wanna know what signal will send out while i press arrow keys...
Of course, you won't get a signal -- the signals are defined in the
signal(7) man page. What you will get depends on what you're doing; in
general it'll be an input on stdin or a keypress.
If you're on a text console or in a shell window, it'll put the
following on stdin for you to read:
up: ^[[A
down: ^[[B
right: ^[[C
left: ^[[D
(following the usual convention of using ^[ to mean the escape
character)
If you're getting input using the curses library, they get mapped to
constants named KEY_UP, KEY_DOWN, KEY_RIGHT, and KEY_LEFT.
If you're writing an X application, it'll depend on the toolkit you're
using. I found what looks like a good description of how it's done in
GTK+ at
http://www.gtkforums.com/viewtopic.php?t=182