Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S275681AbTHOFQe (ORCPT ); Fri, 15 Aug 2003 01:16:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S275684AbTHOFQc (ORCPT ); Fri, 15 Aug 2003 01:16:32 -0400 Received: from note.orchestra.cse.unsw.EDU.AU ([129.94.242.24]:33747 "HELO note.orchestra.cse.unsw.EDU.AU") by vger.kernel.org with SMTP id S275681AbTHOFQa (ORCPT ); Fri, 15 Aug 2003 01:16:30 -0400 From: Neil Brown To: Vojtech Pavlik Date: Fri, 15 Aug 2003 15:16:18 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16188.27810.50931.158166@gargle.gargle.HOWL> Subject: Input issues - key down with no key up cc: linux-kernel@vger.kernel.org X-Mailer: VM 7.17 under Emacs 21.3.2 X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9Dkeycodemax) clear_bit(u, dev->keybit); set_bit(INPUT_KEYCODE(dev, t), dev->keybit); + clear_bit(INPUT_KEYCODE(dev, t), dev->key); return 0; + case EVIOCSKEYNOUP: + if (get_user(t, ((int *) arg) + 0)) return -EFAULT; + if (t < 0 || t > dev->keycodemax) return -EINVAL; + if (get_user(u, ((int *) arg) + 1)) return -EFAULT; + if (u & ~1) return -EINVAL; + if (u) + set_bit(t, dev->keynoup); + else + clear_bit(t, dev->keynoup); + return 0; + case EVIOCSFF: if (dev->upload_effect) { struct ff_effect effect; @@ -303,6 +315,7 @@ static int evdev_ioctl(struct inode *ino switch (_IOC_NR(cmd) & EV_MAX) { case 0: bits = dev->evbit; len = EV_MAX; break; case EV_KEY: bits = dev->keybit; len = KEY_MAX; break; + case EV_REP: bits = dev->keynoup; len = KEY_MAX; break; case EV_REL: bits = dev->relbit; len = REL_MAX; break; case EV_ABS: bits = dev->absbit; len = ABS_MAX; break; case EV_LED: bits = dev->ledbit; len = LED_MAX; break; diff ./drivers/input/input.c~current~ ./drivers/input/input.c --- ./drivers/input/input.c~current~ 2003-08-15 13:44:46.000000000 +1000 +++ ./drivers/input/input.c 2003-08-15 13:44:46.000000000 +1000 @@ -191,8 +191,11 @@ static void input_repeat_key(unsigned lo if (!test_bit(dev->repeat_key, dev->key)) return; - - input_event(dev, EV_KEY, dev->repeat_key, 2); + if (test_bit(dev->repeat_key, dev->keynoup)) + /* don't auto-repeat, just auto-up */ + input_event(dev, EV_KEY, dev->repeat_key, 0); + else + input_event(dev, EV_KEY, dev->repeat_key, 2); input_sync(dev); mod_timer(&dev->timer, jiffies + dev->rep[REP_PERIOD]); diff ./include/linux/input.h~current~ ./include/linux/input.h --- ./include/linux/input.h~current~ 2003-08-15 12:16:16.000000000 +1000 +++ ./include/linux/input.h 2003-08-15 13:44:46.000000000 +1000 @@ -60,6 +60,7 @@ struct input_absinfo { #define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */ #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ +#define EVIOCSKEYNOUP _IOW('E', 0x05, int[2]) /* set 'no-repeat' bit */ #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ @@ -790,6 +791,8 @@ struct input_dev { int abs[ABS_MAX + 1]; int rep[REP_MAX + 1]; + unsigned long keynoup[NBITS(KEY_MAX)]; /* set if key doesn't generate up event */ + unsigned long key[NBITS(KEY_MAX)]; unsigned long led[NBITS(LED_MAX)]; unsigned long snd[NBITS(SND_MAX)]; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/