Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev/adb Pull up following revision(s) (requested by s...
details: https://anonhg.NetBSD.org/src/rev/5dddd9ccb798
branches: netbsd-7
changeset: 799931:5dddd9ccb798
user: snj <snj%NetBSD.org@localhost>
date: Tue Jul 05 19:14:59 2016 +0000
description:
Pull up following revision(s) (requested by sevan in ticket #1187):
sys/dev/adb/adb_kbd.c: revision 1.23
sys/dev/adb/adb_keymap.h: revisions 1.5, 1.6
sys/dev/adb/adb_usb_map.c: revision 1.2
nicely ask the keyboard to distinguish between left and right Control, Alt
and Shift keys.
Welcome to the world of accents and diacritics!
--
Add us.dvorak keymap variant for ADB keyboards. Addresses PR 51255.
Tested by sevan@.
diffstat:
sys/dev/adb/adb_kbd.c | 26 ++++++++++++++++++++++-
sys/dev/adb/adb_keymap.h | 51 +++++++++++++++++++++++++++++++++++++++++++++-
sys/dev/adb/adb_usb_map.c | 10 ++++----
3 files changed, 78 insertions(+), 9 deletions(-)
diffs (158 lines):
diff -r 116b0ca8cce1 -r 5dddd9ccb798 sys/dev/adb/adb_kbd.c
--- a/sys/dev/adb/adb_kbd.c Tue Jul 05 19:09:17 2016 +0000
+++ b/sys/dev/adb/adb_kbd.c Tue Jul 05 19:14:59 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $ */
+/* $NetBSD: adb_kbd.c,v 1.22.4.1 2016/07/05 19:14:59 snj Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.22 2013/11/18 11:02:34 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.22.4.1 2016/07/05 19:14:59 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -190,6 +190,7 @@
#if NWSMOUSE > 0
struct wsmousedev_attach_args am;
#endif
+ uint8_t buffer[2];
sc->sc_dev = self;
sc->sc_ops = aaa->ops;
@@ -333,6 +334,27 @@
break;
}
+ /*
+ * try to switch to extended protocol
+ * as in, tell the keyboard to distinguish between left and right
+ * Shift, Control and Alt keys
+ */
+ cmd = ADBLISTEN(sc->sc_adbdev->current_addr, 3);
+ buffer[0] = sc->sc_adbdev->current_addr;
+ buffer[1] = 3;
+ sc->sc_msg_len = 0;
+ sc->sc_ops->send(sc->sc_ops->cookie, sc->sc_poll, cmd, 2, buffer);
+ adbkbd_wait(sc, 10);
+
+ cmd = ADBTALK(sc->sc_adbdev->current_addr, 3);
+ sc->sc_msg_len = 0;
+ sc->sc_ops->send(sc->sc_ops->cookie, sc->sc_poll, cmd, 0, NULL);
+ adbkbd_wait(sc, 10);
+ if ((sc->sc_msg_len == 4) && (sc->sc_buffer[3] == 3)) {
+ printf("%s: extended protocol enabled\n",
+ device_xname(sc->sc_dev));
+ }
+
if (adbkbd_is_console && (adbkbd_console_attached == 0)) {
wskbd_cnattach(&adbkbd_consops, sc, &adbkbd_keymapdata);
adbkbd_console_attached = 1;
diff -r 116b0ca8cce1 -r 5dddd9ccb798 sys/dev/adb/adb_keymap.h
--- a/sys/dev/adb/adb_keymap.h Tue Jul 05 19:09:17 2016 +0000
+++ b/sys/dev/adb/adb_keymap.h Tue Jul 05 19:14:59 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_keymap.h,v 1.4 2012/08/29 02:44:07 macallan Exp $ */
+/* $NetBSD: adb_keymap.h,v 1.4.14.1 2016/07/05 19:14:59 snj Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -148,8 +148,54 @@
KC(120),KS_Cmd_Screen1, KS_f2,
KC(121),KS_Cmd_ScrollFastDown, KS_Next,
KC(122),KS_Cmd_Screen0, KS_f1,
+ KC(123), KS_Shift_R,
+ KC(124), KS_Alt_R,
+ KC(125), KS_Control_R,
+ KC(127), KS_Cmd_Debugger,
+};
- KC(127), KS_Cmd_Debugger,
+static const keysym_t akbd_keydesc_us_dvorak[] = {
+/* pos command normal shifted */
+ KC(0), KS_a,
+ KC(1), KS_o,
+ KC(2), KS_e,
+ KC(3), KS_u,
+ KC(4), KS_d,
+ KC(5), KS_i,
+ KC(6), KS_semicolon, KS_colon,
+ KC(7), KS_q,
+ KC(8), KS_j,
+ KC(9), KS_k,
+
+ KC(11), KS_x,
+ KC(12), KS_apostrophe, KS_quotedbl,
+ KC(13), KS_comma, KS_less,
+ KC(14), KS_period, KS_greater,
+ KC(15), KS_p,
+ KC(16), KS_f,
+ KC(17), KS_y,
+
+ KC(24), KS_bracketright, KS_braceright,
+ KC(27), KS_bracketleft, KS_braceleft,
+
+ KC(30), KS_equal, KS_plus,
+ KC(31), KS_r,
+ KC(32), KS_g,
+ KC(33), KS_slash, KS_question,
+ KC(34), KS_c,
+ KC(35), KS_l,
+
+ KC(37), KS_n,
+ KC(38), KS_h,
+ KC(39), KS_minus, KS_underscore,
+ KC(40), KS_t,
+ KC(41), KS_s,
+
+ KC(43), KS_w,
+ KC(44), KS_z,
+ KC(45), KS_b,
+ KC(46), KS_m,
+ KC(47), KS_v,
};
static const keysym_t akbd_keydesc_fr[] = {
@@ -404,6 +450,7 @@
static const struct wscons_keydesc akbd_keydesctab[] = {
KBD_MAP(KB_US, 0, akbd_keydesc_us),
+ KBD_MAP(KB_US | KB_DVORAK, KB_US, akbd_keydesc_us_dvorak),
KBD_MAP(KB_FR, KB_US, akbd_keydesc_fr),
KBD_MAP(KB_JP, KB_US, akbd_keydesc_jp),
KBD_MAP(KB_FR | KB_NODEAD, KB_FR, akbd_keydesc_fr_nodead),
diff -r 116b0ca8cce1 -r 5dddd9ccb798 sys/dev/adb/adb_usb_map.c
--- a/sys/dev/adb/adb_usb_map.c Tue Jul 05 19:09:17 2016 +0000
+++ b/sys/dev/adb/adb_usb_map.c Tue Jul 05 19:14:59 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_usb_map.c,v 1.1 2012/08/29 02:44:07 macallan Exp $ */
+/* $NetBSD: adb_usb_map.c,v 1.1.16.1 2016/07/05 19:14:59 snj Exp $ */
/*-
* Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_usb_map.c,v 1.1 2012/08/29 02:44:07 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_usb_map.c,v 1.1.16.1 2016/07/05 19:14:59 snj Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -158,9 +158,9 @@
/* 120, KS_f2 */ 59,
/* 121, KS_Next */ 78,
/* 122, KS_f1 */ 58,
-/* 123 */ 0,
-/* 124 */ 0,
-/* 125 */ 0,
+/* 123, KS_Shift_R */ 229,
+/* 124, KS_Alt_R */ 230,
+/* 125, KS_Control_R */ 228,
/* 126 */ 0,
/* 127, KS_Cmd_Debugger */ 102
};
Home |
Main Index |
Thread Index |
Old Index