summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormkirby <mkirby@NetBSD.org>2009-04-06 17:32:09 +0000
committermkirby <mkirby@NetBSD.org>2009-04-06 17:32:09 +0000
commitff12b9febc56c820424ba28bbb0397decef6e064 (patch)
tree20527466c54ae835f78069a1b625c950df13d434 /sys/dev
parent3e0637e9dde64184425113f9b4ded5903b03a490 (diff)
Add a Czech (QWERTY) keyboard layout, and teach wscons about latin 2 characters.
Original code from Lubomir Kundrak, adapted to current and cleaned up by me. Fixes PR kern/16216 ok agc@ jdc@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pckbport/wskbdmap_mfii.c44
-rw-r--r--sys/dev/wscons/wskbdutil.c77
-rw-r--r--sys/dev/wscons/wsksymdef.h87
3 files changed, 191 insertions, 17 deletions
diff --git a/sys/dev/pckbport/wskbdmap_mfii.c b/sys/dev/pckbport/wskbdmap_mfii.c
index 464cb0a1bba..c5291fadf54 100644
--- a/sys/dev/pckbport/wskbdmap_mfii.c
+++ b/sys/dev/pckbport/wskbdmap_mfii.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbdmap_mfii.c,v 1.16 2009/02/03 17:50:28 ghen Exp $ */
+/* $NetBSD: wskbdmap_mfii.c,v 1.17 2009/04/06 17:32:09 mkirby 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.16 2009/02/03 17:50:28 ghen Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbdmap_mfii.c,v 1.17 2009/04/06 17:32:09 mkirby Exp $");
#include "opt_wskbdmap.h"
#include <sys/types.h>
@@ -418,6 +418,45 @@ static const keysym_t pckbd_keydesc_es[] = {
KC(184), KS_Mode_switch, KS_Multi_key,
};
+static const keysym_t pckbd_keydesc_cz[] = {
+/* pos normal shifted altgr shift-altgr */
+ KC(2), KS_plus, KS_1, KS_asciitilde,
+ KC(3), KS_ecaron, KS_2, KS_dead_caron,
+ KC(4), KS_scaron, KS_3, KS_dead_circumflex,
+ KC(5), KS_ccaron, KS_4, KS_dead_breve,
+ KC(6), KS_rcaron, KS_5, KS_dead_abovering,
+ KC(7), KS_zcaron, KS_6, KS_dead_ogonek,
+ KC(8), KS_yacute, KS_7, KS_dead_grave,
+ KC(9), KS_aacute, KS_8, KS_dead_dotaccent,
+ KC(10), KS_iacute, KS_9, KS_dead_acute,
+ KC(11), KS_eacute, KS_0, KS_dead_hungarumlaut,
+ KC(12), KS_equal, KS_percent, KS_dead_diaeresis,
+ KC(13), KS_dead_acute, KS_dead_caron, KS_dead_cedilla,
+ KC(26), KS_uacute, KS_slash,
+ KC(27), KS_adiaeresis, KS_parenleft, KS_multiply,
+ KC(39), KS_uabovering, KS_quotedbl, KS_dollar,
+ KC(40), KS_section, KS_exclam, KS_ssharp,
+ KC(41), KS_ncaron, KS_parenright, KS_currency,
+ KC(51), KS_comma, KS_question,
+ KC(52), KS_period, KS_colon,
+ KC(53), KS_minus, KS_underscore,
+ KC(86), KS_ampersand, KS_asterisk, KS_less,
+ KC(16), KS_q, KS_Q, KS_backslash,
+ KC(17), KS_w, KS_W, KS_bar,
+ KC(31), KS_s, KS_S, KS_dstroke,
+ KC(32), KS_d, KS_D, KS_Dstroke,
+ KC(33), KS_f, KS_F, KS_bracketleft,
+ KC(34), KS_g, KS_G, KS_bracketright,
+ KC(37), KS_k, KS_K, KS_lstroke,
+ KC(38), KS_l, KS_L, KS_Lstroke,
+ KC(44), KS_z, KS_Z, KS_greater,
+ KC(45), KS_x, KS_X, KS_numbersign,
+ KC(47), KS_v, KS_V, KS_at,
+ KC(48), KS_b, KS_B, KS_braceleft,
+ KC(49), KS_n, KS_N, KS_braceright,
+ KC(184), KS_Mode_switch, KS_Multi_key,
+};
+
static const keysym_t pckbd_keydesc_pt[] = {
/* pos normal shifted altgr shift-altgr */
KC(3), KS_2, KS_quotedbl, KS_at,
@@ -632,6 +671,7 @@ const struct wscons_keydesc pckbd_keydesctab[] = {
KBD_MAP(KB_ES , KB_US, pckbd_keydesc_es),
KBD_MAP(KB_PT, KB_US, pckbd_keydesc_pt),
KBD_MAP(KB_GR, KB_US, pckbd_keydesc_gr),
+ KBD_MAP(KB_CZ, KB_US, pckbd_keydesc_cz),
#endif /* WSKBD_USONLY */
/* placeholders */
diff --git a/sys/dev/wscons/wskbdutil.c b/sys/dev/wscons/wskbdutil.c
index 161c396f8ed..caa614e72b5 100644
--- a/sys/dev/wscons/wskbdutil.c
+++ b/sys/dev/wscons/wskbdutil.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbdutil.c,v 1.15 2008/04/28 20:24:01 martin Exp $ */
+/* $NetBSD: wskbdutil.c,v 1.16 2009/04/06 17:32:09 mkirby Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbdutil.c,v 1.15 2008/04/28 20:24:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbdutil.c,v 1.16 2009/04/06 17:32:09 mkirby Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -187,7 +187,78 @@ static struct compose_tab_s {
{ { KS_dead_semi, KS_gr_y }, KS_gr_yt },
{ { KS_dead_semi, KS_gr_v }, KS_gr_vt },
{ { KS_dead_colon, KS_gr_i }, KS_gr_id },
- { { KS_dead_colon, KS_gr_y }, KS_gr_yd }
+ { { KS_dead_colon, KS_gr_y }, KS_gr_yd },
+
+ /* Latin 2*/
+
+ { { KS_dead_acute, KS_S }, KS_Sacute },
+ { { KS_dead_acute, KS_Z }, KS_Zacute },
+ { { KS_dead_acute, KS_s }, KS_sacute },
+ { { KS_dead_acute, KS_z }, KS_zacute },
+ { { KS_dead_acute, KS_R }, KS_Racute },
+ { { KS_dead_acute, KS_A }, KS_Aacute },
+ { { KS_dead_acute, KS_L }, KS_Lacute },
+ { { KS_dead_acute, KS_C }, KS_Cacute },
+ { { KS_dead_acute, KS_E }, KS_Eacute },
+ { { KS_dead_acute, KS_I }, KS_Iacute },
+ { { KS_dead_acute, KS_N }, KS_Nacute },
+ { { KS_dead_acute, KS_O }, KS_Oacute },
+ { { KS_dead_acute, KS_U }, KS_Uacute },
+ { { KS_dead_acute, KS_Y }, KS_Yacute },
+ { { KS_dead_acute, KS_r }, KS_racute },
+ { { KS_dead_acute, KS_a }, KS_aacute },
+ { { KS_dead_acute, KS_l }, KS_lacute },
+ { { KS_dead_acute, KS_c }, KS_cacute },
+ { { KS_dead_acute, KS_e }, KS_eacute },
+ { { KS_dead_acute, KS_i }, KS_iacute },
+ { { KS_dead_acute, KS_n }, KS_nacute },
+ { { KS_dead_acute, KS_o }, KS_oacute },
+ { { KS_dead_acute, KS_u }, KS_uacute },
+ { { KS_dead_acute, KS_y }, KS_yacute },
+ { { KS_dead_breve, KS_A }, KS_Abreve },
+ { { KS_dead_breve, KS_a }, KS_abreve },
+ { { KS_dead_caron, KS_L }, KS_Lcaron },
+ { { KS_dead_caron, KS_S }, KS_Scaron },
+ { { KS_dead_caron, KS_T }, KS_Tcaron },
+ { { KS_dead_caron, KS_Z }, KS_Zcaron },
+ { { KS_dead_caron, KS_l }, KS_lcaron },
+ { { KS_dead_caron, KS_s }, KS_scaron },
+ { { KS_dead_caron, KS_t }, KS_tcaron },
+ { { KS_dead_caron, KS_z }, KS_zcaron },
+ { { KS_dead_caron, KS_C }, KS_Ccaron },
+ { { KS_dead_caron, KS_E }, KS_Ecaron },
+ { { KS_dead_caron, KS_D }, KS_Dcaron },
+ { { KS_dead_caron, KS_N }, KS_Ncaron },
+ { { KS_dead_caron, KS_R }, KS_Rcaron },
+ { { KS_dead_caron, KS_c }, KS_ccaron },
+ { { KS_dead_caron, KS_e }, KS_ecaron },
+ { { KS_dead_caron, KS_d }, KS_dcaron },
+ { { KS_dead_caron, KS_n }, KS_ncaron },
+ { { KS_dead_caron, KS_r }, KS_rcaron },
+ { { KS_dead_cedilla, KS_S }, KS_Scedilla },
+ { { KS_dead_cedilla, KS_s }, KS_scedilla },
+ { { KS_dead_cedilla, KS_C }, KS_Ccedilla },
+ { { KS_dead_cedilla, KS_T }, KS_Tcedilla },
+ { { KS_dead_cedilla, KS_c }, KS_ccedilla },
+ { { KS_dead_cedilla, KS_t }, KS_tcedilla },
+ { { KS_dead_circumflex, KS_A }, KS_Acircumflex },
+ { { KS_dead_circumflex, KS_I }, KS_Icircumflex },
+ { { KS_dead_circumflex, KS_O }, KS_Ocircumflex },
+ { { KS_dead_circumflex, KS_a }, KS_acircumflex },
+ { { KS_dead_circumflex, KS_i }, KS_icircumflex },
+ { { KS_dead_circumflex, KS_o }, KS_ocircumflex },
+ { { KS_dead_diaeresis, KS_A }, KS_Adiaeresis },
+ { { KS_dead_diaeresis, KS_E }, KS_Ediaeresis },
+ { { KS_dead_diaeresis, KS_O }, KS_Odiaeresis },
+ { { KS_dead_diaeresis, KS_U }, KS_Udiaeresis },
+ { { KS_dead_diaeresis, KS_a }, KS_adiaeresis },
+ { { KS_dead_diaeresis, KS_e }, KS_ediaeresis },
+ { { KS_dead_diaeresis, KS_o }, KS_odiaeresis },
+ { { KS_dead_diaeresis, KS_u }, KS_udiaeresis },
+ { { KS_dead_ogonek, KS_A }, KS_Aogonek },
+ { { KS_dead_ogonek, KS_a }, KS_aogonek },
+ { { KS_dead_ogonek, KS_E }, KS_Eogonek },
+ { { KS_dead_ogonek, KS_e }, KS_eogonek }
};
#define COMPOSE_SIZE sizeof(compose_tab)/sizeof(compose_tab[0])
diff --git a/sys/dev/wscons/wsksymdef.h b/sys/dev/wscons/wsksymdef.h
index 55489db800d..115115998e1 100644
--- a/sys/dev/wscons/wsksymdef.h
+++ b/sys/dev/wscons/wsksymdef.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wsksymdef.h,v 1.62 2009/02/18 04:17:44 snj Exp $ */
+/* $NetBSD: wsksymdef.h,v 1.63 2009/04/06 17:32:09 mkirby Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -153,7 +153,6 @@
#define KS_braceright 0x7d
#define KS_asciitilde 0x7e
#define KS_Delete 0x7f
-
#define KS_nobreakspace 0xa0
#define KS_exclamdown 0xa1
#define KS_cent 0xa2
@@ -248,27 +247,90 @@
#define KS_ucircumflex 0xfb
#define KS_udiaeresis 0xfc
#define KS_yacute 0xfd
-#define KS_thorn 0xfe
+#define KS_thorn 0xfe
#define KS_ydiaeresis 0xff
-
-#define KS_Odoubleacute 0x150
-#define KS_odoubleacute 0x151
-#define KS_Udoubleacute 0x170
-#define KS_udoubleacute 0x171
+#define KS_Abreve 0x0102
+#define KS_abreve 0x0103
+#define KS_Aogonek 0x0104
+#define KS_aogonek 0x0105
+#define KS_Cacute 0x0106
+#define KS_cacute 0x0107
+#define KS_Ccaron 0x010c
+#define KS_ccaron 0x010d
+#define KS_Dcaron 0x010e
+#define KS_dcaron 0x010f
+#define KS_Dstroke 0x0110
+#define KS_dstroke 0x0111
+#define KS_Eogonek 0x0118
+#define KS_eogonek 0x0119
+#define KS_Ecaron 0x011a
+#define KS_ecaron 0x011b
+#define KS_Lacute 0x0139
+#define KS_lacute 0x013a
+#define KS_Lcaron 0x013d
+#define KS_lcaron 0x013e
+#define KS_Lstroke 0x0141
+#define KS_lstroke 0x0142
+#define KS_Nacute 0x0143
+#define KS_nacute 0x0144
+#define KS_Ncaron 0x0147
+#define KS_ncaron 0x0148
+#define KS_Odoubleacute 0x0150
+#define KS_odoubleacute 0x0151
+#define KS_Racute 0x0154
+#define KS_racute 0x0155
+#define KS_Rcaron 0x0158
+#define KS_rcaron 0x0159
+#define KS_Sacute 0x015a
+#define KS_sacute 0x015b
+#define KS_Scedilla 0x015e
+#define KS_scedilla 0x015f
+#define KS_Scaron 0x0160
+#define KS_scaron 0x0161
+#define KS_Tcedilla 0x0162
+#define KS_tcedilla 0x0163
+#define KS_Tcaron 0x0164
+#define KS_tcaron 0x0165
+#define KS_Uabovering 0x016e
+#define KS_uabovering 0x016f
+#define KS_Udoubleacute 0x0170
+#define KS_udoubleacute 0x0171
+#define KS_Zacute 0x0179
+#define KS_zacute 0x017a
+#define KS_Zabovedot 0x017b
+#define KS_zabovedot 0x017c
+#define KS_Zcaron 0x017d
+#define KS_zcaron 0x017e
+
+#define KS_caron 0x02c7
+#define KS_breve 0x02d8
+#define KS_abovedot 0x02d9
+#define KS_ogonek 0x02db
+#define KS_doubleacute 0x02dd
/*
* Group Dead (dead accents)
+ * http://www.unicode.org/charts/PDF/U0300.pdf
+ * dotaccent = "dot above"
+ * hungarumlaut = "double acute"
+ * slash = "short solidus"
*/
#define KS_dead_grave 0x0300
#define KS_dead_acute 0x0301
#define KS_dead_circumflex 0x0302
#define KS_dead_tilde 0x0303
+#define KS_dead_breve 0x0306
#define KS_dead_diaeresis 0x0308
#define KS_dead_abovering 0x030a
+#define KS_dead_caron 0x030c
+#define KS_dead_dotaccent 0x0307
+#define KS_dead_hungarumlaut 0x030b
+#define KS_dead_ogonek 0x0328
+#define KS_dead_slash 0x0337
#define KS_dead_cedilla 0x0327
-#define KS_dead_semi 0x0328
-#define KS_dead_colon 0x0329
+#define KS_dead_semi 0x0328
+#define KS_dead_colon 0x0329
/*
* Group Greek
@@ -580,6 +642,7 @@ action(KB_USER, 0, 0x0100, "user", , "User-defined") \
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_CZ, 0, 0x1500, "cz", , "Czech") \
action(KB_DK, 0, 0x0400, "dk", , "Danish") \
action(KB_FI, 0, 0x0900, "fi", , "Finnish") \
action(KB_FR, 0, 0x0600, "fr", , "French") \
@@ -596,12 +659,12 @@ action(KB_ES, 0, 0x0b00, "es", , "Spanish") \
action(KB_SV, 0, 0x0900, "sv", , "Swedish") \
action(KB_SF, 0, 0x1000, "sf", , "Swiss French") \
action(KB_SG, 0, 0x0f00, "sg", , "Swiss German") \
-action(KB_UA, 0, 0x1200, "ua", , "Ukrainian")
+action(KB_UA, 0, 0x1200, "ua", , "Ukrainian")
#define KB_NONE 0x0000
/* Define all the KB_xx numeric values using above table */
#define KBF_ENUM(tag, tagf, value, cc, ccf, country) tag=value,
-enum { KB_ENC_FUN(KBF_ENUM) KB_NEXT=0x1500 };
+enum { KB_ENC_FUN(KBF_ENUM) KB_NEXT=0x1600 };
/* Define list of KB_xxx and country codes for array initialisation */
#define KBF_ENCTAB(tag, tagf, value, cc, ccf, country) { tag, cc },