Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Add support for the Brazilian keyboard layout to pck...
details: https://anonhg.NetBSD.org/src/rev/422376335bfe
branches: trunk
changeset: 973756:422376335bfe
user: nia <nia%NetBSD.org@localhost>
date: Sun Jul 12 01:35:59 2020 +0000
description:
Add support for the Brazilian keyboard layout to pckbd and ukbd.
This is significantly different from the European Portugese layout,
and was pieced together from Wikipedia, X11 layout files, and to
some extent with trial and error.
Thanks to lun-4 for helping test this.
PR kern/44570
diffstat:
sys/dev/hid/hidkbdmap.c | 40 ++++++++++++++++++++++++++++++++++++++--
sys/dev/pckbport/wskbdmap_mfii.c | 39 +++++++++++++++++++++++++++++++++++++--
sys/dev/wscons/wsksymdef.h | 3 ++-
3 files changed, 77 insertions(+), 5 deletions(-)
diffs (152 lines):
diff -r 0324823d08a5 -r 422376335bfe sys/dev/hid/hidkbdmap.c
--- a/sys/dev/hid/hidkbdmap.c Sat Jul 11 14:31:46 2020 +0000
+++ b/sys/dev/hid/hidkbdmap.c Sun Jul 12 01:35:59 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hidkbdmap.c,v 1.3 2020/04/24 13:29:46 rhialto Exp $ */
+/* $NetBSD: hidkbdmap.c,v 1.4 2020/07/12 01:35:59 nia 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.3 2020/04/24 13:29:46 rhialto Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hidkbdmap.c,v 1.4 2020/07/12 01:35:59 nia Exp $");
#include <sys/types.h>
#include <dev/wscons/wsksymdef.h>
@@ -619,6 +619,40 @@
KC(230), KS_Mode_switch, KS_Multi_key
};
+static const keysym_t hidkbd_keydesc_br[] = {
+/* pos normal shifted altgr shift-altgr */
+ KC(6), KS_c, KS_C, KS_copyright, KS_copyright,
+ KC(8), KS_e, KS_E, KS_currency, KS_currency,
+ KC(16), KS_m, KS_M, KS_mu, KS_mu,
+ KC(20), KS_q, KS_Q, KS_slash, KS_slash,
+ KC(21), KS_r, KS_R, KS_registered, KS_registered,
+ KC(26), KS_w, KS_W, KS_question, KS_question,
+ KC(30), KS_1, KS_exclam, KS_onesuperior, KS_exclamdown,
+ KC(31), KS_2, KS_at, KS_twosuperior, KS_onehalf,
+ KC(32), KS_3, KS_numbersign, KS_threesuperior, KS_threequarters,
+ KC(33), KS_4, KS_dollar, KS_sterling, KS_onequarter,
+ KC(34), KS_5, KS_percent, KS_cent, KS_cent,
+ KC(35), KS_6, KS_dead_diaeresis, KS_notsign, KS_diaeresis,
+ KC(46), KS_equal, KS_plus, KS_section, KS_dead_ogonek,
+ KC(47), KS_dead_acute, KS_dead_grave, KS_acute, KS_grave,
+ KC(48), KS_bracketleft, KS_braceleft, KS_ordfeminine, KS_macron,
+ KC(49), KS_bracketright, KS_braceright, KS_masculine, KS_masculine,
+ KC(50), KS_bracketright, KS_braceright, KS_masculine, KS_masculine,
+ KC(51), KS_ccedilla, KS_Ccedilla, KS_dead_acute, KS_dead_hungarumlaut,
+ KC(52), KS_dead_tilde, KS_dead_circumflex, KS_asciitilde, KS_asciicircum,
+ KC(53), KS_apostrophe, KS_quotedbl, KS_notsign, KS_notsign,
+ KC(56), KS_semicolon, KS_colon, KS_dead_dotaccent, KS_abovedot,
+ KC(100), KS_backslash, KS_bar, KS_masculine, KS_dead_breve,
+ KC(135), KS_slash, KS_question, KS_degree, KS_questiondown,
+ KC(230), KS_Mode_switch, KS_Multi_key,
+};
+
+static const keysym_t hidkbd_keydesc_br_nodead[] = {
+/* pos normal shifted altgr shift-altgr */
+ KC(47), KS_apostrophe, KS_grave, KS_dead_acute, KS_dead_grave,
+ KC(52), KS_asciitilde, KS_asciicircum, KS_dead_tilde, KS_dead_circumflex,
+};
+
#define KBD_MAP(name, base, map) \
{ name, base, sizeof(map)/sizeof(keysym_t), map }
@@ -636,6 +670,8 @@
KBD_MAP(KB_FR, KB_US, hidkbd_keydesc_fr),
KBD_MAP(KB_FR | KB_SWAPCTRLCAPS,KB_FR, hidkbd_keydesc_swapctrlcaps),
KBD_MAP(KB_BE, KB_FR, hidkbd_keydesc_be),
+ KBD_MAP(KB_BR, KB_US, hidkbd_keydesc_br),
+ KBD_MAP(KB_BR | KB_NODEAD, KB_BR, hidkbd_keydesc_br_nodead),
KBD_MAP(KB_DK, KB_US, hidkbd_keydesc_dk),
KBD_MAP(KB_DK | KB_NODEAD, KB_DK, hidkbd_keydesc_dk_nodead),
KBD_MAP(KB_IT, KB_US, hidkbd_keydesc_it),
diff -r 0324823d08a5 -r 422376335bfe sys/dev/pckbport/wskbdmap_mfii.c
--- a/sys/dev/pckbport/wskbdmap_mfii.c Sat Jul 11 14:31:46 2020 +0000
+++ b/sys/dev/pckbport/wskbdmap_mfii.c Sun Jul 12 01:35:59 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbdmap_mfii.c,v 1.27 2020/01/11 21:43:11 nia Exp $ */
+/* $NetBSD: wskbdmap_mfii.c,v 1.28 2020/07/12 01:35:59 nia Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbdmap_mfii.c,v 1.27 2020/01/11 21:43:11 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbdmap_mfii.c,v 1.28 2020/07/12 01:35:59 nia Exp $");
#include "opt_wskbdmap.h"
#include <sys/types.h>
@@ -827,6 +827,39 @@
KC(87), KS_Cmd_Screen9, KS_f10,
KC(88), KS_f11,
};
+
+static const keysym_t pckbd_keydesc_br[] = {
+/* pos normal shifted altgr shift-altgr */
+ KC(2), KS_1, KS_exclam, KS_onesuperior, KS_exclamdown,
+ KC(3), KS_2, KS_at, KS_twosuperior, KS_onehalf,
+ KC(4), KS_3, KS_numbersign, KS_threesuperior, KS_threequarters,
+ KC(5), KS_4, KS_dollar, KS_sterling, KS_onequarter,
+ KC(6), KS_5, KS_percent, KS_cent, KS_cent,
+ KC(7), KS_6, KS_dead_diaeresis, KS_notsign, KS_diaeresis,
+ KC(13), KS_equal, KS_plus, KS_section, KS_dead_ogonek,
+ KC(16), KS_q, KS_Q, KS_slash, KS_slash,
+ KC(17), KS_w, KS_W, KS_question, KS_question,
+ KC(18), KS_e, KS_E, KS_currency, KS_currency,
+ KC(19), KS_r, KS_R, KS_registered, KS_registered,
+ KC(26), KS_dead_acute, KS_dead_grave, KS_acute, KS_grave,
+ KC(27), KS_bracketleft, KS_braceleft, KS_ordfeminine, KS_macron,
+ KC(39), KS_ccedilla, KS_Ccedilla, KS_dead_acute, KS_dead_hungarumlaut,
+ KC(40), KS_dead_tilde, KS_dead_circumflex, KS_asciitilde, KS_asciicircum,
+ KC(41), KS_apostrophe, KS_quotedbl, KS_notsign, KS_notsign,
+ KC(43), KS_bracketright, KS_braceright, KS_masculine, KS_masculine,
+ KC(46), KS_c, KS_C, KS_copyright, KS_copyright,
+ KC(50), KS_m, KS_M, KS_mu, KS_mu,
+ KC(53), KS_semicolon, KS_colon, KS_dead_dotaccent, KS_abovedot,
+ KC(86), KS_backslash, KS_bar, KS_masculine, KS_dead_breve,
+ KC(115), KS_slash, KS_question, KS_degree, KS_questiondown,
+ KC(184), KS_Mode_switch, KS_Multi_key,
+};
+
+static const keysym_t pckbd_keydesc_br_nodead[] = {
+/* pos normal shifted altgr shift-altgr */
+ KC(26), KS_apostrophe, KS_grave, KS_dead_acute, KS_dead_grave,
+ KC(40), KS_asciitilde, KS_asciicircum, KS_dead_tilde, KS_dead_circumflex,
+};
#endif /* WSKBD_USONLY */
#define KBD_MAP(name, base, map) \
@@ -846,6 +879,8 @@
KBD_MAP(KB_SF | KB_NODEAD, KB_SF, pckbd_keydesc_sg_nodead),
KBD_MAP(KB_FR, KB_US, pckbd_keydesc_fr),
KBD_MAP(KB_BE, KB_FR, pckbd_keydesc_be),
+ KBD_MAP(KB_BR, KB_US, pckbd_keydesc_br),
+ KBD_MAP(KB_BR | KB_NODEAD, KB_BR, pckbd_keydesc_br_nodead),
KBD_MAP(KB_DK, KB_US, pckbd_keydesc_dk),
KBD_MAP(KB_DK | KB_NODEAD, KB_DK, pckbd_keydesc_dk_nodead),
KBD_MAP(KB_IT, KB_US, pckbd_keydesc_it),
diff -r 0324823d08a5 -r 422376335bfe sys/dev/wscons/wsksymdef.h
--- a/sys/dev/wscons/wsksymdef.h Sat Jul 11 14:31:46 2020 +0000
+++ b/sys/dev/wscons/wsksymdef.h Sun Jul 12 01:35:59 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsksymdef.h,v 1.67 2018/02/19 14:34:17 maya Exp $ */
+/* $NetBSD: wsksymdef.h,v 1.68 2020/07/12 01:35:59 nia Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -655,6 +655,7 @@
action(KB_US, 0, 0x0200, "us", , "US-English") \
action(KB_UK, 0, 0x0700, "uk", , "UK-English") \
action(KB_BE, 0, 0x1300, "be", , "Belgian") \
+action(KB_BR, 0, 0x1800, "br", , "Brazilian") \
action(KB_CZ, 0, 0x1500, "cz", , "Czech") \
action(KB_DK, 0, 0x0400, "dk", , "Danish") \
action(KB_NL, 0, 0x1600, "nl", , "Dutch") \
Home |
Main Index |
Thread Index |
Old Index