[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with keys
From: |
galapogos |
Subject: |
Re: Problem with keys |
Date: |
Mon, 5 May 2008 21:32:40 -0700 (PDT) |
Thomas Dickey-2 wrote:
>
> On Fri, May 02, 2008 at 01:42:01AM -0700, galapogos wrote:
>>
>> Hi
>> I'm building a simple application using ncurses in Mandriva 2008. I have
>> a
>> simple text user interface asking the user to enter an ASCII string, and
>> then I'm using wgetch() to parse the string, checking if each character
>> is
>> an ASCII character using isascii(). I'm also checking for special
>> characters
>> such as enter and backspace.
>>
>> I'm using KEY_BACKSPACE to detect for backspace. It's ASCII value seems
>> to
>> be 263, but when I test my app using Mandriva (Konsole), backspace seems
>> to
>> be ASCII value 127 instead, so the backspace is never detected. Why is
>> there
>> a discrepancy between the 2?
>
> ncurses will only return KEY_BACKSPACE if the character(s) happen to
> match the string kbs in your terminal's description. It's likely
> that is ^H (8) instead. For some platforms, kbs is normally ^H,
> and for others it is normally ^? (127).
>
I've used infocmp to check. kbs is mapped to ^H, but somehow it's still
being translated to ^? or ASCII 127. When I use stty to change it to ^H
with the command "stty erase ^H", in the Linux console a "^?" shows up
whenever I press the backspace key, and the ncurses application still shows
backspace as ASCII 127.
Haven't tested with Break yet but I suspect the same behavior?
--
View this message in context:
http://www.nabble.com/Problem-with-keys-tp17009973p17071572.html
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.
- Problem with keys, galapogos, 2008/05/02
- Re: Problem with keys, Thomas Dickey, 2008/05/03
- Re: Problem with keys,
galapogos <=
- Re: Problem with keys, Thomas Dickey, 2008/05/06
- Re: Problem with keys, galapogos, 2008/05/06
- Re: Problem with keys, Thomas Dickey, 2008/05/06
- Re: Problem with keys, galapogos, 2008/05/07
- Re: Problem with keys, Thomas Dickey, 2008/05/07