diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-11 16:44:52 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-11 16:44:52 +0000 |
commit | 2f7c83ece2fc2aa97beb6917f7f68ef1300b129c (patch) | |
tree | 6c56290ba1fe10208f2a5dee6b0bef42390e97ed /sys/dev/sun | |
parent | 00b7f38eb00ccedca808a52fa3c2983a6cfa9c68 (diff) |
Enable or disable keyclick on attach, based upon the PROM keyboard-click?
property.
Tested with type 3 and type 4 keyboards.
Diffstat (limited to 'sys/dev/sun')
-rw-r--r-- | sys/dev/sun/sunkbd.c | 16 | ||||
-rw-r--r-- | sys/dev/sun/sunkbdvar.h | 3 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c index 2c750f061ed..572db74e998 100644 --- a/sys/dev/sun/sunkbd.c +++ b/sys/dev/sun/sunkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbd.c,v 1.20 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: sunkbd.c,v 1.21 2005/11/11 16:44:51 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -213,6 +213,20 @@ sunkbd_raw(struct sunkbd_softc *sc, u_int8_t c) } } +int +sunkbd_setclick(struct sunkbd_softc *sc, int click) +{ + u_int8_t c; + + /* Type 2 keyboards do not support keyclick */ + if (sc->sc_id == KB_SUN2) + return (ENXIO); + + c = click ? SKBD_CMD_CLICKON : SKBD_CMD_CLICKOFF; + (*sc->sc_sendcmd)(sc, &c, 1); + return (0); +} + void sunkbd_setleds(void *v, int wled) { diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h index 8349fdf6598..e904f7a1707 100644 --- a/sys/dev/sun/sunkbdvar.h +++ b/sys/dev/sun/sunkbdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbdvar.h,v 1.9 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: sunkbdvar.h,v 1.10 2005/11/11 16:44:51 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -53,6 +53,7 @@ extern struct wskbd_accessops sunkbd_accessops; void sunkbd_bellstop(void *); void sunkbd_decode(u_int8_t, u_int *, int *); void sunkbd_raw(struct sunkbd_softc *, u_int8_t); +int sunkbd_setclick(struct sunkbd_softc *, int); extern const struct wscons_keydesc sunkbd_keydesctab[]; extern struct wskbd_mapdata sunkbd_keymapdata; |