[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
strange key codes
From: |
Holmis |
Subject: |
strange key codes |
Date: |
Sat, 21 Jun 2003 04:17:29 -0500 |
The getch function in the program below returns the same key codes for
ENTER, Ctrl-J and Ctrl-M.
#include <ncurses.h>
int main()
{
int key;
initscr();
noecho();
raw();
key = getch();
printw("%d", key);
mvprintw(LINES-1, 0, "Hit any key to quit...");
getch();
endwin();
}
I have two questions:
1) I want to be able to capture whatever keys have been pressed. Is there
any way to do that?
2) Regarding the keypad function, the manual says that the keycodes defined
in curses may not function for all terminals. That's true in my xterm. The
arrow keys and F5 to F12 works but not the rest.
Is it any point using the keypad function then (regarding portability)?
Isn't it better just to capture the escape sequences for yourself?
(I am running my programs in an xterm).
_____________________________________________
Free email with personality! Over 200 domains!
http://www.MyOwnEmail.com
Looking for friendships,romance and more?
http://www.MyOwnFriends.com
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- strange key codes,
Holmis <=