Module Name: src
Committed By: riz
Date: Fri Jul 20 23:55:54 UTC 2012
Modified Files:
src/sys/dev/usb [netbsd-6]: ukbd.c
Log Message:
Pull up following revision(s) (requested by khorben in ticket #428):
sys/dev/usb/ukbd.c: revision 1.120
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
To generate a diff of this commit:
cvs rdiff -u -r1.115.2.1 -r1.115.2.2 src/sys/dev/usb/ukbd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.115.2.1 src/sys/dev/usb/ukbd.c:1.115.2.2
--- src/sys/dev/usb/ukbd.c:1.115.2.1 Fri Jul 20 23:49:31 2012
+++ src/sys/dev/usb/ukbd.c Fri Jul 20 23:55:54 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.115.2.1 2012/07/20 23:49:31 riz Exp $ */
+/* $NetBSD: ukbd.c,v 1.115.2.2 2012/07/20 23:55:54 riz Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.115.2.1 2012/07/20 23:49:31 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.115.2.2 2012/07/20 23:55:54 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -174,6 +174,13 @@ Static const struct ukbd_keycodetrans tr
};
#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(__NetBSD__) && defined(WSDISPLAY_COMPAT_RAWKBD)
#define NN 0 /* no translation */
/*
@@ -669,6 +676,8 @@ ukbd_intr(struct uhidev *addr, void *ibu
}
#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