summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wskbd.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-05-29 20:23:14 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-05-29 20:23:14 +0000
commit286c2bdbdf6b926fab7e57f77cbce263c0f5f1c2 (patch)
tree792f5442439ff9f581370324be7709c7a0087680 /sys/dev/wscons/wskbd.c
parent2a1119bdf41232e0fe0fe1f92771c4546b3d61a1 (diff)
Add support for the audio volume keys found on many laptops' builtin
keyboard. These specific keys are posted to a kernel thread which will issue mixer commands if an audio device exists. Written by Alexey Vatchenko <avv , mail zp ua> with tweaks by deraadt@ and I.
Diffstat (limited to 'sys/dev/wscons/wskbd.c')
-rw-r--r--sys/dev/wscons/wskbd.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index ac472a09a8f..6c6218a2dbd 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.46 2005/08/14 11:00:15 miod Exp $ */
+/* $OpenBSD: wskbd.c,v 1.47 2006/05/29 20:23:13 miod Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
@@ -82,6 +82,7 @@
#ifndef SMALL_KERNEL
#define BURNER_SUPPORT
#define SCROLLBACK_SUPPORT
+#define HOTKEY_SUPPORT
#endif
#include <sys/param.h>
@@ -110,6 +111,7 @@
#include <dev/wscons/wseventvar.h>
#include <dev/wscons/wscons_callbacks.h>
+#include "audio.h" /* NAUDIO (mixer tuning) */
#include "wsdisplay.h"
#include "wsmux.h"
@@ -429,6 +431,10 @@ wskbd_attach(struct device *parent, struct device *self, void *aux)
sc->sc_base.me_dv.dv_xname, error);
}
#endif
+
+#ifdef HOTKEY_SUPPORT
+ wskbd_hotkey_init();
+#endif
}
void
@@ -1612,6 +1618,23 @@ wskbd_translate(struct wskbd_internal *id, u_int type, int value)
}
}
+#ifdef HOTKEY_SUPPORT
+ /* Submit Audio keys for hotkey processing */
+ if (KS_GROUP(ksym) == KS_GROUP_Function) {
+ switch (ksym) {
+#if NAUDIO > 0
+ case KS_AudioMute:
+ case KS_AudioLower:
+ case KS_AudioRaise:
+ wskbd_hotkey_put(ksym);
+ return (0);
+#endif
+ default:
+ break;
+ }
+ }
+#endif
+
/* Process compose sequence and dead accents */
res = KS_voidSymbol;