[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ncurses-bug
Subject:    Re: Grabbing Escape key
From:       Dave Wood <dave () unrealize ! co ! uk>
Date:       2009-01-15 18:08:55
Message-ID: 20090115180855.GB21815 () Junius
[Download RAW message or body]

On (23:43 13/01/09), Dan Nelson <dnelson@allantgroup.com> put forth the proposition:
>In the last episode (Jan 14), Dave Wood said:
>> How do I use the escape key in an input routine? I looked in
>> ncurses.h but didn't see anything there except ESCDELAY.
>> 
>> I tried using 1 as a keycode but that doesn't seem to be working:
>> 
>> 	int c = getch();
>>       switch(c)
>>       {
>>       case 1:
>>           return;
>>       }
>
>getch should return 27 when ESC is pressed.  What do you see being
>returned when you hit ESC?

Yes 27 works fine thanks. I got '1' because that's what grabkeys returned
when I treid it.

>
>-- 
>	Dan Nelson
>	dnelson@allantgroup.com
>
>
>_______________________________________________
>Bug-ncurses mailing list
>Bug-ncurses@gnu.org
>http://lists.gnu.org/mailman/listinfo/bug-ncurses

-- 
World War Three can be averted by adherence to a strictly enforced
dress code!



_______________________________________________
Bug-ncurses mailing list
Bug-ncurses@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-ncurses
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic