Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Get/set keyclick volume.



details:   https://anonhg.NetBSD.org/src/rev/2540103b9a3d
branches:  trunk
changeset: 515196:2540103b9a3d
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Sep 18 23:25:25 2001 +0000

description:
Get/set keyclick volume.

diffstat:

 sys/dev/dec/dzkbd.c       |   9 ++++++++-
 sys/dev/dec/lk201_ws.c    |  22 +++++++++++++++++++++-
 sys/dev/dec/lk201var.h    |   4 +++-
 sys/dev/tc/zskbd.c        |   9 ++++++++-
 sys/dev/wscons/wsconsio.h |   5 ++++-
 5 files changed, 44 insertions(+), 5 deletions(-)

diffs (126 lines):

diff -r dc06a7656ab3 -r 2540103b9a3d sys/dev/dec/dzkbd.c
--- a/sys/dev/dec/dzkbd.c       Tue Sep 18 23:23:22 2001 +0000
+++ b/sys/dev/dec/dzkbd.c       Tue Sep 18 23:25:25 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dzkbd.c,v 1.1 2000/12/02 17:03:55 ragge Exp $  */
+/*     $NetBSD: dzkbd.c,v 1.2 2001/09/18 23:25:26 ad Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -296,6 +296,13 @@
                lk201_bell(&sc->sc_itl->dzi_ks,
                           (struct wskbd_bell_data *)data);
                return 0;
+       case WSKBDIO_SETKEYCLICK:
+               lk201_set_keyclick(&sc->sc_itl->dz_ks, *(int *)data);
+               return 0;
+       case WSKBDIO_GETKEYCLICK:
+               /* XXX don't dig in kbd internals */
+               *(int *)data = sc->sc_itl->dzi_ks.kcvol;
+               return 0;
        }
        return -1;
 }
diff -r dc06a7656ab3 -r 2540103b9a3d sys/dev/dec/lk201_ws.c
--- a/sys/dev/dec/lk201_ws.c    Tue Sep 18 23:23:22 2001 +0000
+++ b/sys/dev/dec/lk201_ws.c    Tue Sep 18 23:25:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201_ws.c,v 1.2 1998/10/22 17:55:20 drochner Exp $ */
+/* $NetBSD: lk201_ws.c,v 1.3 2001/09/18 23:25:26 ad Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -61,6 +61,7 @@
 
        send(lks, LK_CL_ENABLE);
        send(lks, LK_PARAM_VOLUME(3));
+       lks->kcvol = (8 - 3) * 100 / 8;
 
        lks->bellvol = -1; /* not yet set */
 
@@ -176,3 +177,22 @@
 
        lks->leds_state = leds;
 }
+
+void
+lk201_set_keyclick(lks, vol)
+       struct lk201_state *lks;
+       int vol;
+{
+       unsigned int newvol;
+
+       if (vol == 0)
+               send(lks, LK_CL_DISABLE);
+       else {
+               newvol = 8 - vol * 8 / 100;
+               if (newvol > 7)
+                       newvol = 7;
+
+               send(lks, LK_CL_ENABLE);
+               send(lks, LK_PARAM_VOLUME(newvol));
+       }
+}
diff -r dc06a7656ab3 -r 2540103b9a3d sys/dev/dec/lk201var.h
--- a/sys/dev/dec/lk201var.h    Tue Sep 18 23:23:22 2001 +0000
+++ b/sys/dev/dec/lk201var.h    Tue Sep 18 23:25:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201var.h,v 1.2 1998/10/22 17:55:20 drochner Exp $ */
+/* $NetBSD: lk201var.h,v 1.3 2001/09/18 23:25:27 ad Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -43,9 +43,11 @@
        int down_keys_list[LK_KLL];
        int bellvol;
        int leds_state;
+       int kcvol;
 };
 
 int lk201_init __P((struct lk201_state *));
 int lk201_decode __P((struct lk201_state *, int, u_int *, int *));
 void lk201_bell __P((struct lk201_state *, struct wskbd_bell_data *));
 void lk201_set_leds __P((struct lk201_state *, int));
+void lk201_set_keyclick __P((struct lk201_state *, int));
diff -r dc06a7656ab3 -r 2540103b9a3d sys/dev/tc/zskbd.c
--- a/sys/dev/tc/zskbd.c        Tue Sep 18 23:23:22 2001 +0000
+++ b/sys/dev/tc/zskbd.c        Tue Sep 18 23:25:25 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zskbd.c,v 1.1 2000/07/05 02:48:50 nisimura Exp $       */
+/*     $NetBSD: zskbd.c,v 1.2 2001/09/18 23:25:26 ad Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -342,6 +342,13 @@
                lk201_bell(&sc->sc_itl->zsi_ks,
                           (struct wskbd_bell_data *)data);
                return 0;
+       case WSKBDIO_SETKEYCLICK:
+               lk201_set_keyclick(&sc->sc_itl->zsi_ks, *(int *)data);
+               return 0;
+       case WSKBDIO_GETKEYCLICK:
+               /* XXX don't dig in kbd internals */
+               *(int *)data = sc->sc_itl->zsi_ks.kcvol;
+               return 0;
        }
        return -1;
 }
diff -r dc06a7656ab3 -r 2540103b9a3d sys/dev/wscons/wsconsio.h
--- a/sys/dev/wscons/wsconsio.h Tue Sep 18 23:23:22 2001 +0000
+++ b/sys/dev/wscons/wsconsio.h Tue Sep 18 23:25:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsconsio.h,v 1.41 2001/09/04 17:57:16 drochner Exp $ */
+/* $NetBSD: wsconsio.h,v 1.42 2001/09/18 23:25:25 ad Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -150,6 +150,9 @@
 #define                WSKBD_TRANSLATED        0
 #define                WSKBD_RAW               1
 
+#define        WSKBDIO_SETKEYCLICK     _IOW('W', 21, int)
+#define        WSKBDIO_GETKEYCLICK     _IOR('W', 22, int)
+
 /*
  * Mouse ioctls (32 - 63)
  */



Home | Main Index | Thread Index | Old Index