mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Marcel J.E. Mol" <marcel@mesa.nl>
To: Massimo Dal Zotto <dz@cs.unitn.it>
Cc: linux-kernel@vger.kernel.org, stephane@tuxfinder.org
Subject: Re: [PATCH] SMM BIOS on Dell i8100
Date: Tue, 6 Nov 2001 23:46:55 +0100	[thread overview]
Message-ID: <20011106234655.A28603@joshua.mesa.nl> (raw)
In-Reply-To: <20011105231759.02B541195E@a.mx.spoiled.org> <200111061645.RAA02115@fandango.cs.unitn.it>
In-Reply-To: <200111061645.RAA02115@fandango.cs.unitn.it>; from dz@cs.unitn.it on Tue, Nov 06, 2001 at 05:45:13PM +0100

Massimo,
Here is a small patch to sort of implement autorepeat for the volume buttons.
It just adds a -r | --repeat <count> option to i8kbuttons. With the
default timeout and -r 1 I get a reasonable autorepeat function.
The name/docs might not be optimal but I leave that to you if you choose
to include the patch. It is agains i8kutils-1.2.

-Marcel
--- i8kbuttons.1.org	Tue Nov  6 22:30:56 2001
+++ i8kbuttons.1	Tue Nov  6 22:33:47 2001
@@ -36,6 +36,11 @@
 \fB\-t\fR, \fB\-\-timeout\fR <\fImilliseconds\fP>
 Specifies the interval in milliseconds at which the daemon checks the
 button status. Useful values are in the range of 50\-200. Default is 100.
+.TP 
+\fB\-r\fR, \fB\-\-repeat\fR <\fIcount\fP>
+Enables autorepeat (0 is off is default). While holding down one of the volume
+buttons, the volume is changed every count timeoutintervals. So with -t 100 -r 2
+it will change every 200 milliseconds.
 .LP 
 .SH "FILES"
 .LP 
--- i8kbuttons.c.org	Tue Nov  6 22:18:09 2001
+++ i8kbuttons.c	Tue Nov  6 22:24:08 2001
@@ -89,6 +89,7 @@
     printf("	-d|--down <command>\n");
     printf("	-m|--mute <command>\n");
     printf("	-t|--timeout <milliseconds>\n");
+    printf("	-r|--repeat <count>\n");
     printf("\n");
 }
 
@@ -97,6 +98,8 @@
 {
     int fd, status;
     int timeout = POLL_TIMEOUT;
+    int repeat = 0;
+    int autorpt = 0;
     int last = 0;
     char *progname;
     struct timespec req;
@@ -137,6 +140,11 @@
 	    }
 	    continue;
 	}
+	if ((strcmp(argv[0],"-r")==0) || (strcmp(argv[0],"--repeat")==0)) {
+	    if (argc < 2) break;
+	    autorpt = atoi(argv[1]);
+	    continue;
+	}
 	break;
     }
     if (argc > 0) {
@@ -162,8 +170,10 @@
 	DPRINTF("%d\n", status);
 
 	if (status == last) {
-	    continue;
+	    if (!autorpt || (repeat++ < autorpt))
+	        continue;
 	}
+        repeat = 0;
 	last = status;
 
 	switch (status) {



-- 
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        marcel@mesa.nl                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com

  parent reply	other threads:[~2001-11-06 22:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-05  9:03 Stephane Jourdois
2001-11-05 16:03 ` Jeff Garzik
2001-11-05 16:35   ` Stephane Jourdois
2001-11-05 23:17   ` Juri Haberland
2001-11-06 12:24     ` Stephane Jourdois
2001-11-06 16:45     ` Massimo Dal Zotto
2001-11-06 17:09       ` Juri Haberland
2001-11-06 22:46       ` Marcel J.E. Mol [this message]
2001-11-07  9:44       ` Stephane Jourdois
2001-11-07 10:01         ` Marcel J.E. Mol
2001-11-07 10:13           ` Stephane Jourdois
2001-11-07 14:21             ` Massimo Dal Zotto
2001-11-07 10:27         ` Massimo Dal Zotto
2001-11-07 10:29       ` David Woodhouse
     [not found] ` <20011105130954.A24310@joshua.mesa.nl>
2001-11-05 17:01   ` Stephane Jourdois
2001-11-05 17:20     ` Marcel J.E. Mol
2001-11-05 17:37       ` Stephane Jourdois
2001-11-05 21:52         ` Marcel J.E. Mol
2001-11-05 19:00   ` Georg Nikodym
2001-11-06 13:58     ` Stephane Jourdois
2001-11-08 18:14 Massimo Dal Zotto
2001-11-09 12:34 ` Stephane Jourdois
2001-11-09 14:57   ` Massimo Dal Zotto
     [not found] <12948.1005329220@redhat.com>
2001-11-09 18:57 ` Massimo Dal Zotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011106234655.A28603@joshua.mesa.nl \
    --to=marcel@mesa.nl \
    --cc=dz@cs.unitn.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephane@tuxfinder.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®