>Synopsis: Prtsc button doesn't work on USB keyboard
>Category: xenocara
>Environment:
System : OpenBSD 7.6
Details : OpenBSD 7.6-current (GENERIC.MP) #20: Fri Oct 11 23:56:48
CEST 2024
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
I've noticed that Prtsc doesn't work when I plug a USB keyboard into my
laptop. The same key on the embedded keyboard works fine.
On console both keyboards work but send different code: 70 from USB and
183 from embedded.
I've asked on misc@ and had multiple confirmations that this is not
unique behavior https://marc.info/?l=openbsd-misc&m=172869341512696&w=2
Thus, here is the old topic with the same issue:
https://marc.info/?l=openbsd-misc&m=170757405114868&w=2
>How-To-Repeat:
1. probably attach any USB keyboard to a laptop
2. run xev
3. push Prtsc button
4. see no event
>Fix:
This patch fixed Prtsc on my keyboard:
Index: driver/xf86-input-keyboard/src/at_scancode.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-input-keyboard/src/at_scancode.c,v
retrieving revision 1.5
diff -u -p -r1.5 at_scancode.c
--- driver/xf86-input-keyboard/src/at_scancode.c 17 Dec 2015 06:03:10
-0000 1.5
+++ driver/xf86-input-keyboard/src/at_scancode.c 12 Oct 2024 00:25:40
-0000
@@ -95,6 +95,7 @@ ATScancode(InputInfoPtr pInfo, int *scan
case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs
delete */
case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad
enter */
case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right
ctrl */
+ case KEY_ShiftL:
case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print
*/
case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp
divide */
case KEY_Alt: *scanCode = KEY_AltLang; break; /* right
alt */
@@ -113,7 +114,6 @@ ATScancode(InputInfoPtr pInfo, int *scan
keyboards */
case 0x01: *scanCode = KEY_R_0xF4; break;
case 0x03: *scanCode = KEY_R_0xF5; break;
- case 0x2A:
case 0x36:
return TRUE;
default:
--
wbr, Kirill