Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I wanna know the name of the signal that will appear while i press arrow key..

26 views
Skip to first unread message

Chrisshia

unread,
Mar 30, 2013, 8:40:53 AM3/30/13
to

Chrisshia

unread,
Mar 30, 2013, 10:03:54 AM3/30/13
to
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...

Joe Pfeiffer

unread,
Mar 30, 2013, 10:52:53 PM3/30/13
to
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

Chrisshia

unread,
Apr 1, 2013, 6:12:01 AM4/1/13
to
thank you very much..the answer is overall..i can learn many things from it..
0 new messages