diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 2002-05-29 20:43:45 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 2002-05-29 20:43:45 +0000 |
commit | 9374390cf13cb01427ebc5768447ecefb272f08a (patch) | |
tree | a13f0178a331902d4c24f691c0a772e47009b9e0 /sys | |
parent | bf867a67725789dfad746d2c0782810da103750b (diff) |
Add a new wskbd type for Sun type 5 keyboards (WSKBD_TYPE_SUN5).
This is needed since eg Swedish type 4 and 5 keyboard has keycodes
with different keycodes. eg AltGr and Compose are switched in type 5
compared with type 4.
This change will need a new Xserver to allow sun type 5 keyboards.
-moj ok miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/comkbd_ebus.c | 20 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/z8530kbd.c | 16 | ||||
-rw-r--r-- | sys/dev/sun/sunkbd.c | 47 | ||||
-rw-r--r-- | sys/dev/sun/sunkbdvar.h | 6 | ||||
-rw-r--r-- | sys/dev/wscons/wsconsio.h | 5 |
5 files changed, 82 insertions, 12 deletions
diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c index b22e61177ab..ec8b943a337 100644 --- a/sys/arch/sparc64/dev/comkbd_ebus.c +++ b/sys/arch/sparc64/dev/comkbd_ebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comkbd_ebus.c,v 1.6 2002/04/08 17:49:42 jason Exp $ */ +/* $OpenBSD: comkbd_ebus.c,v 1.7 2002/05/29 20:43:43 maja Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -239,7 +239,11 @@ comkbd_attach(parent, self, aux) cn_tab->cn_dev = makedev(77, sc->sc_dv.dv_unit); /* XXX */ cn_tab->cn_pollc = wskbd_cnpollc; cn_tab->cn_getc = wskbd_cngetc; - wskbd_cnattach(&comkbd_consops, sc, &sunkbd_keymapdata); + if (ISTYPE5(sc->sc_layout)) { + wskbd_cnattach(&comkbd_consops, sc, &sunkbd5_keymapdata); + } else { + wskbd_cnattach(&comkbd_consops, sc, &sunkbd_keymapdata); + } sc->sc_ier = IER_ETXRDY | IER_ERXRDY; COM_WRITE(sc, com_ier, sc->sc_ier); COM_READ(sc, com_iir); @@ -249,7 +253,11 @@ comkbd_attach(parent, self, aux) a.console = console; - a.keymap = &sunkbd_keymapdata; + if (ISTYPE5(sc->sc_layout)) { + a.keymap = &sunkbd5_keymapdata; + } else { + a.keymap = &sunkbd_keymapdata; + } a.accessops = &comkbd_accessops; a.accesscookie = sc; sc->sc_wskbddev = config_found(self, &a, wskbddevprint); @@ -308,7 +316,11 @@ comkbd_ioctl(v, cmd, data, flag, p) switch (cmd) { case WSKBDIO_GTYPE: - *d_int = WSKBD_TYPE_SUN; + if (ISTYPE5(sc->sc_layout)) { + *d_int = WSKBD_TYPE_SUN5; + } else { + *d_int = WSKBD_TYPE_SUN; + } return (0); case WSKBDIO_SETLEDS: comkbd_setleds(v, *d_int); diff --git a/sys/arch/sparc64/dev/z8530kbd.c b/sys/arch/sparc64/dev/z8530kbd.c index 8b8982b83f6..4a12fbc0c97 100644 --- a/sys/arch/sparc64/dev/z8530kbd.c +++ b/sys/arch/sparc64/dev/z8530kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530kbd.c,v 1.11 2002/03/21 03:09:33 jason Exp $ */ +/* $OpenBSD: z8530kbd.c,v 1.12 2002/05/29 20:43:43 maja Exp $ */ /* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -405,12 +405,16 @@ zskbd_attach(parent, self, aux) printf("\n"); a.console = console; - a.keymap = &sunkbd_keymapdata; + if (ISTYPE5(zst->zst_layout)) { + a.keymap = &sunkbd5_keymapdata; + } else { + a.keymap = &sunkbd_keymapdata; + } a.accessops = &zskbd_accessops; a.accesscookie = zst; if (console) - wskbd_cnattach(&zskbd_consops, zst, &sunkbd_keymapdata); + wskbd_cnattach(&zskbd_consops, zst, a.keymap); zst->zst_wskbddev = config_found(self, &a, wskbddevprint); } @@ -1153,7 +1157,11 @@ zskbd_ioctl(v, cmd, data, flag, p) switch (cmd) { case WSKBDIO_GTYPE: - *d_int = WSKBD_TYPE_SUN; + if (ISTYPE5(zst->zst_layout)) { + *d_int = WSKBD_TYPE_SUN5; + } else { + *d_int = WSKBD_TYPE_SUN; + } return (0); case WSKBDIO_SETLEDS: zskbd_set_leds(zst, *d_int); diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c index cfd65897307..62852b8d1cf 100644 --- a/sys/dev/sun/sunkbd.c +++ b/sys/dev/sun/sunkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbd.c,v 1.4 2002/04/08 17:49:42 jason Exp $ */ +/* $OpenBSD: sunkbd.c,v 1.5 2002/05/29 20:43:43 maja Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -196,6 +196,35 @@ const keysym_t sunkbd_keydesc_sv_nodead[] = { KC(0x41), KS_diaeresis, KS_asciicircum, KS_asciitilde, }; +const keysym_t sunkbd5_keydesc_sv[] = { + + KC(0x0d), KS_Mode_switch, + KC(0x0f), KS_asciitilde, KS_asciicircum, + KC(0x1f), KS_2, KS_quotedbl, KS_at, + KC(0x20), KS_3, KS_numbersign, KS_sterling, + KC(0x21), KS_4, KS_currency, KS_dollar, + KC(0x23), KS_6, KS_ampersand, + KC(0x24), KS_7, KS_slash, KS_braceleft, + KC(0x25), KS_8, KS_parenleft, KS_bracketleft, + KC(0x26), KS_9, KS_parenright, KS_bracketright, + KC(0x27), KS_0, KS_equal, KS_braceright, + KC(0x28), KS_plus, KS_question, KS_backslash, + KC(0x29), KS_dead_acute, KS_dead_grave, + KC(0x2a), KS_paragraph, KS_onehalf, + KC(0x40), KS_aring, + KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde, + KC(0x43), KS_Multi_key, + KC(0x4c), KS_Control_L, + KC(0x56), KS_odiaeresis, + KC(0x57), KS_adiaeresis, + KC(0x58), KS_apostrophe, KS_asterisk, KS_grave, + KC(0x6b), KS_comma, KS_semicolon, + KC(0x6c), KS_period, KS_colon, + KC(0x6d), KS_minus, KS_underscore, + KC(0x77), KS_Caps_Lock, + KC(0x7c), KS_less, KS_greater, KS_bar, +}; + #define KBD_MAP(name, base, map) \ { name, base, sizeof(map)/sizeof(keysym_t), map } @@ -206,6 +235,13 @@ const struct wscons_keydesc sunkbd_keydesctab[] = { {0, 0, 0, 0}, }; +const struct wscons_keydesc sunkbd5_keydesctab[] = { + KBD_MAP(KB_US, 0, sunkbd_keydesc_us), + KBD_MAP(KB_SV, KB_US, sunkbd5_keydesc_sv), + KBD_MAP(KB_SV | KB_NODEAD, KB_SV, sunkbd_keydesc_sv_nodead), + {0, 0, 0, 0}, +}; + struct wskbd_mapdata sunkbd_keymapdata = { sunkbd_keydesctab, #ifdef SUNKBD_LAYOUT @@ -214,3 +250,12 @@ struct wskbd_mapdata sunkbd_keymapdata = { KB_US, #endif }; + +struct wskbd_mapdata sunkbd5_keymapdata = { + sunkbd5_keydesctab, +#ifdef SUNKBD5_LAYOUT + SUNKBD5_LAYOUT, +#else + KB_US, +#endif +}; diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h index 77058f6557d..503f046581f 100644 --- a/sys/dev/sun/sunkbdvar.h +++ b/sys/dev/sun/sunkbdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbdvar.h,v 1.2 2002/04/08 17:49:42 jason Exp $ */ +/* $OpenBSD: sunkbdvar.h,v 1.3 2002/05/29 20:43:43 maja Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -39,3 +39,7 @@ extern const keysym_t sunkbd_keydesc_us[]; extern const struct wscons_keydesc sunkbd_keydesctab[]; extern struct wskbd_mapdata sunkbd_keymapdata; +extern const struct wscons_keydesc sunkbd5_keydesctab[]; +extern struct wskbd_mapdata sunkbd5_keymapdata; + +#define ISTYPE5(layout) ((layout) > 0x20) diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index d6675067483..e27c0135893 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsconsio.h,v 1.17 2002/05/22 21:29:10 jason Exp $ */ +/* $OpenBSD: wsconsio.h,v 1.18 2002/05/29 20:43:44 maja Exp $ */ /* $NetBSD: wsconsio.h,v 1.31.2.1 2000/07/07 09:49:17 hannken Exp $ */ /* @@ -108,7 +108,8 @@ struct wscons_event { #define WSKBD_TYPE_HPC_BTN 8 /* HPC/PsPC buttons */ #define WSKBD_TYPE_ARCHIMEDES 9 /* Archimedes keyboard */ #define WSKBD_TYPE_ADB 10 /* Apple ADB keyboard */ -#define WSKBD_TYPE_SUN 11 /* Sun Type3/4/5 */ +#define WSKBD_TYPE_SUN 11 /* Sun Type3/4 */ +#define WSKBD_TYPE_SUN5 12 /* Sun Type5 */ /* Manipulate the keyboard bell. */ struct wskbd_bell_data { |