Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/adb behave like USB keyboards - KB_US uses ctrl-alt-...



details:   https://anonhg.NetBSD.org/src/rev/b47e9791f612
branches:  trunk
changeset: 938038:b47e9791f612
user:      macallan <macallan%NetBSD.org@localhost>
date:      Mon Aug 31 17:51:56 2020 +0000

description:
behave like USB keyboards - KB_US uses ctrl-alt-Fn, KB_APPLE variant uses
Command-Fn

diffstat:

 sys/dev/adb/adb_keymap.h |  34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diffs (75 lines):

diff -r 51c96c8aca11 -r b47e9791f612 sys/dev/adb/adb_keymap.h
--- a/sys/dev/adb/adb_keymap.h  Mon Aug 31 17:41:38 2020 +0000
+++ b/sys/dev/adb/adb_keymap.h  Mon Aug 31 17:51:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adb_keymap.h,v 1.7 2020/08/29 22:33:53 macallan Exp $  */
+/*     $NetBSD: adb_keymap.h,v 1.8 2020/08/31 17:51:56 macallan Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -89,11 +89,11 @@
     KC(51),                    KS_Delete,
     KC(52),                    KS_KP_Enter,    /* Pretend this is alt-R ? */
     KC(53),                    KS_Escape,
-    KC(54),                    KS_Control_L,
-    KC(55),  KS_Cmd,           KS_Meta_L,      /* Command */
+    KC(54),  KS_Cmd1,          KS_Control_L,
+    KC(55),                    KS_Meta_L,      /* Command */
     KC(56),                    KS_Shift_L,
     KC(57),                    KS_Caps_Lock,
-    KC(58),                    KS_Alt_L,       /* Option */
+    KC(58),  KS_Cmd2,          KS_Alt_L,       /* Option */
     KC(59),                    KS_Left,
     KC(60),                    KS_Right,
     KC(61), KS_Cmd_ScrollSlowDown, KS_Down,
@@ -154,6 +154,13 @@
     KC(127),  KS_Cmd_Debugger,
 };
 
+static const keysym_t akbd_keydesc_apple[] = {
+/*  pos      command           normal          shifted */
+    KC(54),                    KS_Control_L,
+    KC(55),  KS_Cmd,           KS_Meta_L,      /* Command */
+    KC(58),                    KS_Alt_L,       /* Option */
+};
+
 static const keysym_t akbd_keydesc_us_dvorak[] = {
 /*  pos      command           normal          shifted */
     KC(0),                     KS_a,
@@ -450,18 +457,35 @@
 
 static const struct wscons_keydesc akbd_keydesctab[] = {
        KBD_MAP(KB_US,                  0,      akbd_keydesc_us),
+       KBD_MAP(KB_US | KB_APPLE,       KB_US,  akbd_keydesc_apple),
        KBD_MAP(KB_US | KB_DVORAK,      KB_US,  akbd_keydesc_us_dvorak),
+       KBD_MAP(KB_US | KB_DVORAK | KB_APPLE, KB_US | KB_DVORAK,
+                                               akbd_keydesc_apple),
        KBD_MAP(KB_FR,                  KB_US,  akbd_keydesc_fr),
+       KBD_MAP(KB_FR | KB_NODEAD,      KB_FR,  akbd_keydesc_fr_nodead),
+       KBD_MAP(KB_FR | KB_APPLE,       KB_FR,  akbd_keydesc_apple),
+       KBD_MAP(KB_FR | KB_NODEAD | KB_APPLE,   KB_FR | KB_DVORAK,
+                                               akbd_keydesc_apple),
        KBD_MAP(KB_JP,                  KB_US,  akbd_keydesc_jp),
-       KBD_MAP(KB_FR | KB_NODEAD,      KB_FR,  akbd_keydesc_fr_nodead),
+       KBD_MAP(KB_JP | KB_APPLE,       KB_JP,  akbd_keydesc_apple),
        KBD_MAP(KB_SF,                  KB_US,  akbd_keydesc_sf),
+       KBD_MAP(KB_SF | KB_APPLE,       KB_SF,  akbd_keydesc_apple),
        KBD_MAP(KB_SV,                  KB_US,  akbd_keydesc_sv),
+       KBD_MAP(KB_SV | KB_APPLE,       KB_SV,  akbd_keydesc_apple),
        KBD_MAP(KB_SV | KB_NODEAD,      KB_SV,  akbd_keydesc_sv_nodead),
+       KBD_MAP(KB_SV | KB_NODEAD | KB_APPLE,   KB_SV | KB_NODEAD,
+                                               akbd_keydesc_apple),
        KBD_MAP(KB_DE,                  KB_US,  akbd_keydesc_de),
+       KBD_MAP(KB_DE | KB_APPLE,       KB_DE,  akbd_keydesc_apple),
        KBD_MAP(KB_DE | KB_NODEAD,      KB_DE,  akbd_keydesc_de_nodead),
+       KBD_MAP(KB_DE | KB_NODEAD | KB_APPLE,   KB_DE | KB_NODEAD,
+                                               akbd_keydesc_apple),
        KBD_MAP(KB_UK,                  KB_US,  akbd_keydesc_uk),
+       KBD_MAP(KB_UK | KB_APPLE,       KB_UK,  akbd_keydesc_apple),
        KBD_MAP(KB_ES,                  KB_US,  akbd_keydesc_es),
+       KBD_MAP(KB_ES | KB_APPLE,       KB_ES,  akbd_keydesc_apple),
        KBD_MAP(KB_PT,                  KB_US,  akbd_keydesc_pt),
+       KBD_MAP(KB_PT | KB_APPLE,       KB_PT,  akbd_keydesc_apple),
        {0, 0, 0, 0}
 };
 



Home | Main Index | Thread Index | Old Index