[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;
        key = getch();
        printw("%d", key);
        mvprintw(LINES-1, 0, "Hit any key to quit...");

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!
Looking for friendships,romance and more?

reply via email to

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