From 1cfc8bebf013db113f5a2f6721c55b172d9ab364 Mon Sep 17 00:00:00 2001 From: mdodd Date: Thu, 10 Apr 2003 08:06:56 +0000 Subject: Fix debounce. I forgot these bits in my last commit. Submitted by: Mathew Kanner --- usr.bin/usbhidaction/usbhidaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin/usbhidaction') diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c index b05de5b..e79011c 100644 --- a/usr.bin/usbhidaction/usbhidaction.c +++ b/usr.bin/usbhidaction/usbhidaction.c @@ -204,7 +204,7 @@ main(int argc, char **argv) if (cmd->value != val && cmd->anyvalue == 0) goto next; if ((cmd->debounce == 0) || - (cmd->debounce && ((cmd->lastseen == -1) || + ((cmd->debounce == 1) && ((cmd->lastseen == -1) || (cmd->lastseen != val)))) { docmd(cmd, val, dev, argc, argv); goto next; @@ -415,6 +415,8 @@ parse_conf(const char *conf, report_desc_t repd, int reportid, int ignore) foundhid: hid_end_parse(d); + cmd->lastseen = -1; + cmd->lastused = -1; cmd->item = h; cmd->name = strdup(name); cmd->action = strdup(action); -- cgit v1.1