From 46e949203325417c2a3470dc30fa0d5e76b2f92e Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sat, 11 May 2019 14:19:17 +0000 Subject: Add the colemak keyboard layout. OK deraadt@ --- sys/dev/pckbc/wskbdmap_mfii.c | 26 +++++++++++++++++++++++++- sys/dev/wscons/wsksymdef.h | 6 ++++-- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/dev/pckbc/wskbdmap_mfii.c b/sys/dev/pckbc/wskbdmap_mfii.c index d10a909eece..66d1ed95ec4 100644 --- a/sys/dev/pckbc/wskbdmap_mfii.c +++ b/sys/dev/pckbc/wskbdmap_mfii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbdmap_mfii.c,v 1.45 2016/08/31 15:25:27 jca Exp $ */ +/* $OpenBSD: wskbdmap_mfii.c,v 1.46 2019/05/11 14:19:16 abieber Exp $ */ /* $NetBSD: wskbdmap_mfii.c,v 1.15 2000/05/19 16:40:04 drochner Exp $ */ /* @@ -597,6 +597,27 @@ static const keysym_t pckbd_keydesc_us_dvorak[] = { KC(53), KS_z, }; +static const keysym_t pckbd_keydesc_us_colemak[] = { +/* pos command normal shifted */ + KC(18), KS_f, + KC(19), KS_p, + KC(20), KS_g, + KC(21), KS_j, + KC(22), KS_l, + KC(23), KS_u, + KC(24), KS_y, + KC(25), KS_semicolon, KS_colon, + KC(31), KS_r, + KC(32), KS_s, + KC(33), KS_t, + KC(34), KS_d, + KC(36), KS_n, + KC(37), KS_e, + KC(38), KS_i, KS_I, + KC(39), KS_o, + KC(49), KS_k, +}; + static const keysym_t pckbd_keydesc_swapctrlcaps[] = { /* pos command normal shifted */ KC(29), KS_Caps_Lock, @@ -1129,6 +1150,7 @@ const struct wscons_keydesc pckbd_keydesctab[] = { KBD_MAP(KB_NO | KB_NODEAD, KB_NO, pckbd_keydesc_no_nodead), KBD_MAP(KB_US | KB_DECLK, KB_US, pckbd_keydesc_us_declk), KBD_MAP(KB_US | KB_DVORAK, KB_US, pckbd_keydesc_us_dvorak), + KBD_MAP(KB_US | KB_COLEMAK, KB_US, pckbd_keydesc_us_colemak), KBD_MAP(KB_US | KB_SWAPCTRLCAPS, KB_US, pckbd_keydesc_swapctrlcaps), KBD_MAP(KB_US | KB_IOPENER, KB_US, pckbd_keydesc_iopener), KBD_MAP(KB_UK | KB_SWAPCTRLCAPS, KB_UK, pckbd_keydesc_swapctrlcaps), @@ -1139,6 +1161,8 @@ const struct wscons_keydesc pckbd_keydesctab[] = { KBD_MAP(KB_BE | KB_SWAPCTRLCAPS, KB_BE, pckbd_keydesc_swapctrlcaps), KBD_MAP(KB_US | KB_DVORAK | KB_SWAPCTRLCAPS, KB_US | KB_DVORAK, pckbd_keydesc_swapctrlcaps), + KBD_MAP(KB_US | KB_COLEMAK | KB_SWAPCTRLCAPS, KB_US | KB_COLEMAK, + pckbd_keydesc_swapctrlcaps), KBD_MAP(KB_US | KB_IOPENER | KB_SWAPCTRLCAPS, KB_US | KB_IOPENER, pckbd_keydesc_swapctrlcaps), KBD_MAP(KB_ES, KB_US, pckbd_keydesc_es), diff --git a/sys/dev/wscons/wsksymdef.h b/sys/dev/wscons/wsksymdef.h index 486b8840c4f..e35cb8fb3b3 100644 --- a/sys/dev/wscons/wsksymdef.h +++ b/sys/dev/wscons/wsksymdef.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsksymdef.h,v 1.37 2016/08/31 11:05:48 jca Exp $ */ +/* $OpenBSD: wsksymdef.h,v 1.38 2019/05/11 14:19:16 abieber Exp $ */ /* $NetBSD: wsksymdef.h,v 1.34.4.1 2000/07/07 09:49:54 hannken Exp $ */ /*- @@ -746,6 +746,7 @@ #define KB_IOPENER 0x00000040 /* f1-f12 -> ESC,f1-f11 */ #define KB_MACHDEP 0x00000080 /* machine dependent */ #define KB_APPLE 0x00010000 /* Apple specific layout */ +#define KB_COLEMAK 0x02000000 /* Colemak layout */ #define KB_DEFAULT 0x80000000 /* (attach-only) default layout */ #define KB_ENCTAB \ @@ -788,6 +789,7 @@ { KB_METAESC, "metaesc" }, \ { KB_IOPENER, "iopener" }, \ { KB_MACHDEP, "machdep" }, \ - { KB_APPLE, "apple" } + { KB_APPLE, "apple" }, \ + { KB_COLEMAK, "colemak" } #endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */ -- cgit v1.2.3