ncurses and dodgy key scancodes on an HP
From: Dave Slutzkin (daveslutzkin_at_fastmail.fm)
Date: 09/26/03
- Next message: Stefan Malon: "Pointer to Textsegment"
- Previous message: Michael Kerrisk: "Re: Change Notification Functions, what are they?"
- Next in thread: Thomas Dickey: "Re: ncurses and dodgy key scancodes on an HP"
- Reply: Thomas Dickey: "Re: ncurses and dodgy key scancodes on an HP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Sep 2003 23:24:15 -0700
Hi all.
I've just started using a new machine, a HP/Compaq something or other,
with a fairly new Redhat 9 installation.
I've got some very simple ncurses code which is giving strange
results. Basically, the scancode given for a particular key on the
keyboard (and only that key, as far as I can tell) is just wrong.
(And another one is sorta weird.)
This is currently running under an xterm. I'd love to try it out on
the console, but the i845 chipset has a nasty crash bug with the
built-in DRM stuff, I think, so I can't actually use the console.
Weird, hey?
For a start, PageUp on the keypad gives the same code as PageDown on
the keypad. And 5 on the keypad appears to have no mapping (which
isn't a real problem).
When I hit the number keys on the keypad:
7/Home 262
8/Up 259
9/PgUp 339 **** PPAGE
4/Left 260
5 27 - 91 - 69
6/Right 261
1/End 360
2/Down 258
3/PgDn 339 **** PPAGE
0/Ins 331
./Del 330
And on the rest of the keyboard:
Insert 331
Home 262
PageUp 339 **** PPAGE
Delete 330
End 360
PageDown 338 **** NPAGE
Up 259
Left 260
Down 258
Right 261
This is with a simple test program:
#include <iostream>
#include <ncurses.h>
int main(int argc,char * argv[])
{
initscr();
cbreak();
noecho();
nonl();
intrflush(stdscr,FALSE);
keypad(stdscr,FALSE);
nodelay(stdscr,FALSE);
bool quit = false;
while (!quit)
{
int c = getch();
if (c != -1) std::cerr << c << '\n';
if (c == 'Q') quit = true;
}
endwin();
}
The keyboard is a HP brand. And that's all I know, really.
Can anyone pinpoint the source of this? I'm happy to hack in and fix
it, but I haven't got the faintest idea where it's coming from. Is it
the xterm terminfo? I know nothing about that, and hope I never have
to. :-)
Thanks,
Dave.
- Next message: Stefan Malon: "Pointer to Textsegment"
- Previous message: Michael Kerrisk: "Re: Change Notification Functions, what are they?"
- Next in thread: Thomas Dickey: "Re: ncurses and dodgy key scancodes on an HP"
- Reply: Thomas Dickey: "Re: ncurses and dodgy key scancodes on an HP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]