Results 1 to 1 of 1
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 ...
- 05-02-2008 #1Linux Newbie
- Join Date
- Apr 2008
- Posts
- 110
Problem with ncurses and character sets/keys
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 backspace. Its 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?
Also, I've tested the app on another self compiled Linux kernel(2.6.22.19) with busybox. In this environment, backspace is ASCII value 263, so KEY_BACKSPACE works. However, the "Break" key, as well as Alt-Break, Shift-Break, Ctrl-Break, seems to convert to 2 ASCII characters - "[P". This doesn't happen in Mandriva. What's wrong here? Why is break an ASCII character when it's clearly not? Has this something to do with the character set and/or termcap/terminfo or something?
Thanks.


Reply With Quote