Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sbin/wsconsctl Pull up revision 1.4 (requested by recht...



details:   https://anonhg.NetBSD.org/src/rev/0e3043f8f076
branches:  netbsd-2-0
changeset: 561308:0e3043f8f076
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jun 07 09:44:13 2004 +0000

description:
Pull up revision 1.4 (requested by recht in ticket #451):
PR/19925: David Ferlier: add scrolling support to wscons

diffstat:

 sbin/wsconsctl/keyboard.c |  30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diffs (63 lines):

diff -r 3c7c2e9874cf -r 0e3043f8f076 sbin/wsconsctl/keyboard.c
--- a/sbin/wsconsctl/keyboard.c Mon Jun 07 09:44:07 2004 +0000
+++ b/sbin/wsconsctl/keyboard.c Mon Jun 07 09:44:13 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keyboard.c,v 1.3 2001/09/19 12:45:24 ad Exp $ */
+/*     $NetBSD: keyboard.c,v 1.3.4.1 2004/06/07 09:44:13 tron Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -52,6 +52,7 @@
                                                           and in util.c */
 static struct wskbd_keyrepeat_data repeat;
 static struct wskbd_keyrepeat_data dfrepeat;
+static struct wskbd_scroll_data scroll;
 static int ledstate;
 static kbd_t kbdencoding;
 
@@ -71,6 +72,8 @@
     { "ledstate",              &ledstate,      FMT_UINT,       0 },
     { "encoding",              &kbdencoding,   FMT_KBDENC,     FLG_MODIFY },
     { "keyclick",              &keyclick,      FMT_UINT,       FLG_MODIFY },
+       { "scroll.mode",        &scroll.mode,   FMT_UINT,       FLG_MODIFY },
+       { "scroll.modifier",    &scroll.modifier,       FMT_UINT,       FLG_MODIFY },
 };
 
 int keyboard_field_tab_len = sizeof(keyboard_field_tab)/
@@ -141,6 +144,15 @@
                ioctl(fd, WSKBDIO_GETKEYCLICK, &keyclick);
                /* Optional; don't complain. */
        }
+       
+       scroll.which = 0;
+       if (field_by_value(&scroll.mode)->flags & FLG_GET)
+               scroll.which |= WSKBD_SCROLL_DOMODE;
+       if (field_by_value(&scroll.modifier)->flags & FLG_GET)
+               scroll.which |= WSKBD_SCROLL_DOMODIFIER;
+       if (scroll.which != 0 && 
+               ioctl(fd, WSKBDIO_GETSCROLL, &scroll) < 0)
+                       err(1, "WSKBDIO_GETSCROLL");
 }
 
 void
@@ -229,4 +241,20 @@
                        err(1, "WSKBDIO_SETKEYCLICK");
                pr_field(field_by_value(&keyclick), " -> ");
        }
+
+
+       scroll.which = 0;
+       if (field_by_value(&scroll.mode)->flags & FLG_SET)
+               scroll.which |= WSKBD_SCROLL_DOMODE;
+       if (field_by_value(&scroll.modifier)->flags & FLG_SET)
+               scroll.which |= WSKBD_SCROLL_DOMODIFIER;
+
+       if (scroll.which & WSKBD_SCROLL_DOMODE)
+               pr_field(field_by_value(&scroll.mode), " -> ");
+       if (scroll.which & WSKBD_SCROLL_DOMODIFIER)
+               pr_field(field_by_value(&scroll.modifier), " -> ");
+       if (scroll.which != 0 &&
+               ioctl(fd, WSKBDIO_SETSCROLL, &scroll) < 0)
+               err (1, "WSKBDIO_SETSCROLL");
 }
+



Home | Main Index | Thread Index | Old Index