Subject: Re: Anyone got a type-4 keyboard?
To: Julian Coleman <jdc@coris.demon.co.uk>
From: Greg A. Woods <woods@weird.com>
List: port-sparc
Date: 10/09/2002 15:22:38
The more I look at sys/dev/sun/kbd.c and kbd_tables.c the more I think
the removal of KEYSYM_STRING mappings for the type-4 arrow keys in
revsion 1.5 of kbd_tables.c was unnecessary and wrong. As far as I can
tell by reading the code the numlock indirection should just work since
it seems to happen before the keysym mapping for KEYSYM_STRING happens
at the next level up so if NUMLOCK is on then the keypad keys will
automatically be mapped to the numbers instead of being left as keysyms.
I guess we should ask Gordon though if he can remember for sure why he
took them out. Are you still here on the list Gordon?
I don't currently have a spare monitor with which to test SunOS with a
type-4 keyboard (I still coincidentally have one disk that'll boot SunOS
(5.6 I think), and I have an idle machine, but it has only a cg6).
However given the SunOS termcap and terminfo entries I'm reasonably
confident that the mapping should be there even if it's actually broken
in SunOS.
Someone might test NetBSD with a real type-4 though with these patches,
and I suppose it wouldn't hurt to test a real type-5 with them too just
in case there's a clash (in which case we'd really need a separate
type-5 table I think). (I'm sort of guessing on the type-3 keymap, and
I could probably eventually get one to test):
Index: sys/dev/sun/kbd_tables.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/syssrc/sys/dev/sun/kbd_tables.c,v
retrieving revision 1.7
diff -c -c -r1.7 sys/dev/sun/kbd_tables.c
*** sys/dev/sun/kbd_tables.c 12 Apr 2002 14:27:29 -0000 1.7
--- sys/dev/sun/kbd_tables.c 9 Oct 2002 05:20:29 -0000
***************
*** 393,400 ****
/* 65: ] */ ']',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_HOLE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7),
! /* 69: R8/Up */ KEYSYM_FUNC_R(8),
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_HOLE,
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
--- 393,400 ----
/* 65: ] */ ']',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_HOLE,
! /* 68: R7/Home */ KEYSYM_STRING | 0, /* is for real in 'oldsun' TERM type */
! /* 69: R8/Up */ KEYSYM_STRING | 1,
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_HOLE,
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
***************
*** 416,424 ****
/* 88: backslash */ '\\',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_HOLE,
! /* 91: R10/Left */ KEYSYM_FUNC_R(10),
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_FUNC_R(12),
/* 94: KP_Insert */ KEYSYM_HOLE,
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: */ KEYSYM_HOLE,
--- 416,424 ----
/* 88: backslash */ '\\',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_HOLE,
! /* 91: R10/Left */ KEYSYM_STRING | 3,
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_STRING | 4,
/* 94: KP_Insert */ KEYSYM_HOLE,
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: */ KEYSYM_HOLE,
***************
*** 438,444 ****
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_FUNC_R(14),
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
--- 438,444 ----
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_STRING | 2,
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
***************
*** 525,532 ****
/* 65: ] */ '}',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_HOLE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7),
! /* 69: R8/Up */ KEYSYM_FUNC_R(8),
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_HOLE,
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
--- 525,532 ----
/* 65: ] */ '}',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_HOLE,
! /* 68: R7/Home */ KEYSYM_STRING | 0, /* is for real in 'oldsun' TERM type */
! /* 69: R8/Up */ KEYSYM_STRING | 1,
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_HOLE,
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
***************
*** 548,556 ****
/* 88: backslash */ '|',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_HOLE,
! /* 91: R10/Left */ KEYSYM_FUNC_R(10),
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_FUNC_R(12),
/* 94: KP_Insert */ KEYSYM_HOLE,
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: */ KEYSYM_HOLE,
--- 548,556 ----
/* 88: backslash */ '|',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_HOLE,
! /* 91: R10/Left */ KEYSYM_STRING | 3,
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_STRING | 4,
/* 94: KP_Insert */ KEYSYM_HOLE,
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: */ KEYSYM_HOLE,
***************
*** 570,576 ****
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_FUNC_R(14),
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
--- 570,576 ----
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_STRING | 2,
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
***************
*** 662,669 ****
/* 65: ] */ ']',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_COMPOSE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7),
! /* 69: R8/Up */ KEYSYM_FUNC_R(8),
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_FUNC_N(15),
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
--- 662,669 ----
/* 65: ] */ ']',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_COMPOSE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7), /* KEYSYM_STRING | 0, */
! /* 69: R8/Up */ KEYSYM_STRING | 1,
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_FUNC_N(15),
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
***************
*** 685,693 ****
/* 88: backslash */ '\\',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_FUNC_N(11),
! /* 91: R10/Left */ KEYSYM_FUNC_R(10),
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_FUNC_R(12),
/* 94: KP_Insert */ KEYSYM_FUNC_N(8),
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: T5_PgUp */ KEYSYM_FUNC_R(9),
--- 685,693 ----
/* 88: backslash */ '\\',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_FUNC_N(11),
! /* 91: R10/Left */ KEYSYM_STRING | 3,
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_STRING | 4,
/* 94: KP_Insert */ KEYSYM_FUNC_N(8),
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: T5_PgUp */ KEYSYM_FUNC_R(9),
***************
*** 707,713 ****
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_FUNC_R(14),
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
--- 707,713 ----
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_STRING | 2,
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
***************
*** 794,801 ****
/* 65: ] */ '}',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_COMPOSE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7),
! /* 69: R8/Up */ KEYSYM_FUNC_R(8),
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_FUNC_N(15),
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
--- 794,801 ----
/* 65: ] */ '}',
/* 66: Delete */ 0x7f,
/* 67: Compose */ KEYSYM_COMPOSE,
! /* 68: R7/Home */ KEYSYM_FUNC_R(7), /* KEYSYM_STRING | 0, */
! /* 69: R8/Up */ KEYSYM_STRING | 1,
/* 70: R9/PgUp */ KEYSYM_FUNC_R(9),
/* 71: KP_Minus */ KEYSYM_FUNC_N(15),
/* 72: L7/Open */ KEYSYM_FUNC_L(7),
***************
*** 817,825 ****
/* 88: backslash */ '|',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_FUNC_N(11),
! /* 91: R10/Left */ KEYSYM_FUNC_R(10),
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_FUNC_R(12),
/* 94: KP_Insert */ KEYSYM_FUNC_N(8),
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: T5_PgUp */ KEYSYM_FUNC_R(9),
--- 817,825 ----
/* 88: backslash */ '|',
/* 89: Return */ '\r',
/* 90: KP_Enter */ KEYSYM_FUNC_N(11),
! /* 91: R10/Left */ KEYSYM_STRING | 3,
/* 92: R11/KP_5 */ KEYSYM_FUNC_R(11),
! /* 93: R12/Right */ KEYSYM_STRING | 4,
/* 94: KP_Insert */ KEYSYM_FUNC_N(8),
/* 95: L9/Find */ KEYSYM_FUNC_L(9),
/* 96: T5_PgUp */ KEYSYM_FUNC_R(9),
***************
*** 839,845 ****
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_FUNC_R(14),
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
--- 839,845 ----
/* 110: Shift_R */ KEYSYM_SETMOD | KBMOD_SHIFT_R,
/* 111: Linefeed */ '\n',
/* 112: R13/End */ KEYSYM_FUNC_R(13),
! /* 113: R14/Down */ KEYSYM_STRING | 2,
/* 114: R15/PgDn */ KEYSYM_FUNC_R(15),
/* 115: */ KEYSYM_HOLE,
/* 116: */ KEYSYM_HOLE,
--
Greg A. Woods
+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>