From 286c2bdbdf6b926fab7e57f77cbce263c0f5f1c2 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 29 May 2006 20:23:14 +0000 Subject: 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 with tweaks by deraadt@ and I. --- sys/dev/wscons/wskbd.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'sys/dev/wscons/wskbd.c') 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 @@ -110,6 +111,7 @@ #include #include +#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; -- cgit v1.2.3