tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
two keys with same keycode on ADB
Hello
The french ADB keyboard features a < key at the right of the left shift
key. On the console it works fine, however with X, it displays a @. The
@ key also displays a @.
I ran a program to dump wskbd events, and both keys produce the same
keycode 53. This is the same with french keymap or default US keymap
(tested in singler user before any wscons configuration is done). My
understanding is that this cannot be worked around by a keymap, because
there is no way to distinguish the keys.
Reading the sources, I see that userland programs get a ADB to USB
translation defined in sys/dev/adb/adb_usb_map.c. When using a real USB
keyboard, the < key reports keycode 100 instead of 53. I therefore
suspect the ADB to USB translation is wrong.
Below is the proposed fix, The grave key on a US keyboard is at the
same location as the < key on the french keyboard, hence the left hand
side seems correct. However, I am almost certain changing the right hand
side will break US keyboard. I probbaly miss something here.
--- sys/dev/adb/adb_usb_map.c 8 Nov 2014 16:52:35 -0000 1.2
+++ sys/dev/adb/adb_usb_map.c 8 May 2022 02:04:22 -0000
@@ -84,9 +84,9 @@
/* 46, KS_m */ 16,
/* 47, KS_period */ 55,
/* 48, KS_Tab */ 43,
/* 49, KS_space */ 44,
-/* 50, KS_grave */ 53,
+/* 50, KS_grave */ 100,
/* 51, KS_Delete */ 42,
/* 52, KS_KP_Enter */ 88,
/* 53, KS_Escape */ 41,
/* 54, KS_Control_L */ 224,
--
Emmanuel Dreyfus
manu%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index