Running the following code in gnome-terminal, I get this when I press 7 on my
keypad:
27 33
91 133
49 61
126 176
I can't capture the keypad home key. If I hit the dedicated home key (between
the keypad and the letter keys, I get this:
Home hit
262 406
So that works.
Running the following code in xterm, I get this:
Home hit
262 406
Which is working.
But no matter how I set numlock, I can't get KEY_A1 on either gnome-terminal or
xterm.
Same story with end, pgup and pgdn.
Am I doing something wrong or is there something wrong with the terminal
emulation (or ncurses)? Or is it my keyboard (a Microsoft Natural 4000)?
#include <ncurses.h>
int main(void)
{
int ch;
initscr();
noecho();
cbreak();
keypad(stdscr,TRUE);
while (ch !='a')
{
ch=getch();
if(ch==KEY_HOME)
printw("Home hit\n");
if(ch==KEY_A1)
printw("A1 hit\n");
printw("%d %o\n",ch,ch);
refresh();
}
endwin();
return 0;
}
--
MELVILLE THEATRE ~ Melville Sask ~
http://www.melvilletheatre.com