Source-Changes-HG archive

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

[src/trunk]: src/sys/dev provide KB_APPLE layout variant which uses Command-F...



details:   https://anonhg.NetBSD.org/src/rev/b748e338ea0a
branches:  trunk
changeset: 937997:b748e338ea0a
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sat Aug 29 22:42:53 2020 +0000

description:
provide KB_APPLE layout variant which uses Command-F* to switch console screens
mostly for consistent behaviour across *Books which may have ADB or USB
keyboards

diffstat:

 sys/dev/hid/hidkbdmap.c    |  13 +++++++++++--
 sys/dev/wscons/wsksymdef.h |   6 ++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (67 lines):

diff -r 074ccad86426 -r b748e338ea0a sys/dev/hid/hidkbdmap.c
--- a/sys/dev/hid/hidkbdmap.c   Sat Aug 29 22:33:53 2020 +0000
+++ b/sys/dev/hid/hidkbdmap.c   Sat Aug 29 22:42:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hidkbdmap.c,v 1.11 2020/08/26 10:34:03 jdolecek Exp $  */
+/*     $NetBSD: hidkbdmap.c,v 1.12 2020/08/29 22:42:53 macallan Exp $  */
 
 /*
  * Copyright (c) 1999,2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hidkbdmap.c,v 1.11 2020/08/26 10:34:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hidkbdmap.c,v 1.12 2020/08/29 22:42:53 macallan Exp $");
 
 #include <sys/types.h>
 #include <dev/wscons/wsksymdef.h>
@@ -284,6 +284,14 @@
     KC(224),                   KS_Caps_Lock,
 };
 
+/* switch screens using Command-F* as on ADB keyboards */
+Static const keysym_t hidkbd_keydesc_apple[] = {
+/*  pos      command           normal          shifted */
+    KC(224),                   KS_Control_L,
+    KC(226),                   KS_Alt_L,
+    KC(227),  KS_Cmd,          KS_Meta_L,
+};
+
 Static const keysym_t hidkbd_keydesc_de[] = {
 /*  pos      normal            shifted         altgr           shift-altgr */
     KC(16),  KS_m,             KS_M,           KS_mu,
@@ -813,6 +821,7 @@
        KBD_MAP(KB_US | KB_DVORAK | KB_SWAPCTRLCAPS,    KB_US| KB_DVORAK,
                hidkbd_keydesc_swapctrlcaps),
        KBD_MAP(KB_US | KB_COLEMAK,     KB_US,  hidkbd_keydesc_us_colemak),
+       KBD_MAP(KB_US | KB_APPLE,       KB_US,  hidkbd_keydesc_apple),
        KBD_MAP(KB_JP,                  KB_US,  hidkbd_keydesc_jp),
        KBD_MAP(KB_JP | KB_SWAPCTRLCAPS,KB_JP,  hidkbd_keydesc_swapctrlcaps),
        KBD_MAP(KB_DE,                  KB_US,  hidkbd_keydesc_de),
diff -r 074ccad86426 -r b748e338ea0a sys/dev/wscons/wsksymdef.h
--- a/sys/dev/wscons/wsksymdef.h        Sat Aug 29 22:33:53 2020 +0000
+++ b/sys/dev/wscons/wsksymdef.h        Sat Aug 29 22:42:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsksymdef.h,v 1.73 2020/07/13 09:50:12 nia Exp $ */
+/*     $NetBSD: wsksymdef.h,v 1.74 2020/08/29 22:42:53 macallan Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -644,6 +644,7 @@
 #define KB_IOPENER             0x0040  /* f1-f12 -> ESC,f1-f11 */
 #define KB_MACHDEP             0x0080  /* machine dependent */
 #define KB_COLEMAK         0x00010000  /* Colemak layout */
+#define KB_APPLE           0x00020000  /* Apple USB layout */
 
 /*
  * Define keyboard type and texts all in one table.
@@ -699,6 +700,7 @@
        { KB_METAESC,   "metaesc" }, \
        { KB_IOPENER,   "iopener" }, \
        { KB_MACHDEP,   "machdep" }, \
-       { KB_COLEMAK,   "colemak" }
+       { KB_COLEMAK,   "colemak" }, \
+       { KB_APPLE,     "apple" }
 
 #endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */



Home | Main Index | Thread Index | Old Index