help-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't understand input


From: Sanket Desai
Subject: Re: Don't understand input
Date: Sat, 29 Oct 2005 10:17:51 +0530


Hi Chris,
 
Using getch() function you will be able to get the key code. But it will be for only Ascii characters i.e. from 0 to 255. But complex key codes or lets say combination keys like as you say Ctrl+A, are double byte means you will need to call getch() twice to read actual key code. In first read it will give 0 (most probably) and in second getch() it will return another code. Give it a try.
 
regards,
 
Sanket.
 
On 10/29/05, Chris Seaton <address@hidden> wrote:
Hello,

I really don't understand input in ncurses at all.

I can read really simple key strokes such as the letter A, and more
exotic key strokes such as the left arrow, but I don't understand how
I read anything more complex than that.

For example, how would I read Control-A? When I try that getch simply
returns 1. Some key-strokes such as Alt-A return two characters (all
out of the ASCII range), but Alt-B returns three! I can't understand
what the escape sequence is.

How can I read the escape key without a really noticeable delay?

Am I setting things up wrong? What do I need to do?

I know you can read key strokes such as these, as programs like Emacs
and Vim do it.

Thanks

Chris Seaton


_______________________________________________
Help-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-ncurses


reply via email to

[Prev in Thread] Current Thread [Next in Thread]