linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IR remote control autorepeat / evdev
@ 2011-05-08  4:38 Anssi Hannula
  2011-05-10  4:11 ` Peter Hutterer
  0 siblings, 1 reply; 26+ messages in thread
From: Anssi Hannula @ 2011-05-08  4:38 UTC (permalink / raw)
  To: linux-media, linux-input@vger.kernel.org, xorg-devel

Hi all!

Most IR/RF remotes differ from normal keyboards in that they don't
provide release events. They do provide native repeat events, though.

Currently the Linux kernel RC/input subsystems provide a simulated
autorepeat for remote controls (default delay 500ms, period 33ms), and
X.org server ignores these events and generates its own autorepeat for them.

The kernel RC subsystem provides a simulated release event when 250ms
has passed since the last native event (repeat or non-repeat) was
received from the device.

This is problematic, since it causes lots of extra repeat events to be
always sent (for up to 250ms) after the user has released the remote
control button, which makes the remote quite uncomfortable to use.

Now, IMO something should be done to fix this. But what exactly?

Here are two ideas that would remove these ghost repeats:

1. Do not provide any repeat/release simulation in the kernel for RC
devices (by default?), just provide both keydown and immediate release
events for every native keypress or repeat received from the device.
+ Very simple to implement
- We lose the ability to track repeats, i.e. if a new event was a repeat
  or a new keypress; "holding down" a key becomes impossible

or
2. Replace kernel autorepeat simulation by passing through the native
repeat events (probably filtering them according to REP_DELAY and
REP_PERIOD), and have a device property bit (fetchable via EVIOCGPROP)
indicating that the keyrelease is simulated, and have the X server use
the native repeats instead of softrepeats for such a device.
+ The userspace correctly gets repeat events tagged as repeats and
  release events when appropriate (albeit a little late)
- Adds complexity. Also, while the kernel part is quite easy to
  implement, I'm not sure if the X server part is.

or
3. Same as 1., but indicate the repeatness of an event with a new
   additional special event before EV_SYN (sync event).
+ Simple to implement
- Quite hacky, and userspace still can't guess from initial
  keypress/release if the key is still pressed down or not.

4. Same as 1., but have a new EV_RC with RC_KEYDOWN and RC_KEYUP events,
   with RC_KEYDOWN sent when a key is pressed down a first time along
   with the normal EV_KEY event, and RC_KEYUP sent when the key is
   surely released (e.g. 250ms without native repeat events or another
   key got pressed, i.e. like the simulated keyup now).
+ Simple to implement, works as expected with most userspace apps with
  no changes to them; and if an app wants to know the repeatness of an
  event or held-down-ness of a key, it can do that.
- Repeatness of the event is hidden behind a new API.

What do you think? Or any other ideas?

2 and 4 seem nicest to me.
(I don't know how feasible 2 would be on X server side, though)

-- 
Anssi Hannula

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-05-23 21:36 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08  4:38 IR remote control autorepeat / evdev Anssi Hannula
2011-05-10  4:11 ` Peter Hutterer
2011-05-10  5:14   ` Anssi Hannula
2011-05-10  5:30     ` Peter Hutterer
2011-05-10 13:43       ` Anssi Hannula
     [not found]         ` <4DC940E5.2070902-X3B1VOXEql0@public.gmane.org>
2011-05-11  4:46           ` Mauro Carvalho Chehab
     [not found]             ` <4DCA1496.20304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-05-11 16:33               ` Anssi Hannula
2011-05-11 16:51                 ` Mauro Carvalho Chehab
2011-05-11 17:59                   ` Anssi Hannula
2011-05-11 20:53                     ` Dmitry Torokhov
2011-05-12  0:17                       ` Anssi Hannula
2011-05-12  0:55                         ` Mauro Carvalho Chehab
2011-05-11 23:52                     ` Mauro Carvalho Chehab
2011-05-12  0:37                       ` Anssi Hannula
2011-05-12  1:10                         ` Mauro Carvalho Chehab
2011-05-12  1:36                           ` Mauro Carvalho Chehab
2011-05-12  3:48                             ` Jarod Wilson
2011-05-12  6:05                             ` Peter Hutterer
2011-05-12 13:24                               ` Jarod Wilson
2011-05-13  7:51                               ` Mauro Carvalho Chehab
2011-05-16  1:35                                 ` Peter Hutterer
2011-05-12 23:48                             ` Anssi Hannula
2011-05-13 22:39                               ` Mauro Carvalho Chehab
2011-05-13 23:07                                 ` Anssi Hannula
2011-05-15  3:41                                   ` Mauro Carvalho Chehab
2011-05-23 21:36                                     ` Anssi Hannula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).