Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Convert keycodes 0x7f, 0x80 and 0x81 to PMF even...
details: https://anonhg.NetBSD.org/src/rev/d996600db47f
branches: trunk
changeset: 778958:d996600db47f
user: khorben <khorben%NetBSD.org@localhost>
date: Sun Apr 22 14:19:24 2012 +0000
description:
Convert keycodes 0x7f, 0x80 and 0x81 to PMF events VOLUME_TOGGLE,
VOLUME_UP and VOLUME_DOWN as observed on my Sun Type 7 USB keyboard, and
according to the documentation mentioned above.
"works here" macallan@ and myself
diffstat:
sys/dev/usb/ukbd.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r 228435ab9721 -r d996600db47f sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c Sun Apr 22 14:13:32 2012 +0000
+++ b/sys/dev/usb/ukbd.c Sun Apr 22 14:19:24 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.119 2012/04/22 14:13:32 khorben Exp $ */
+/* $NetBSD: ukbd.c,v 1.120 2012/04/22 14:19:24 khorben Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.119 2012/04/22 14:13:32 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.120 2012/04/22 14:19:24 khorben Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -175,6 +175,13 @@
};
#endif
+Static const struct ukbd_keycodetrans trtab_generic[] = {
+ { 0x7f, IS_PMF | PMFE_AUDIO_VOLUME_TOGGLE },
+ { 0x80, IS_PMF | PMFE_AUDIO_VOLUME_UP },
+ { 0x81, IS_PMF | PMFE_AUDIO_VOLUME_DOWN },
+ { 0x00, 0x00 }
+};
+
#if defined(WSDISPLAY_COMPAT_RAWKBD)
#define NN 0 /* no translation */
/*
@@ -660,6 +667,8 @@
}
#endif
+ ukbd_translate_keycodes(sc, ud, trtab_generic);
+
if ((sc->sc_flags & FLAG_DEBOUNCE) && !(sc->sc_flags & FLAG_POLLING)) {
/*
* Some keyboards have a peculiar quirk. They sometimes
Home |
Main Index |
Thread Index |
Old Index