diff options
author | Noone Important <nxhxzi702 at sneakemail.com> | 2006-01-09 12:25:09 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 12:25:09 -0500 |
commit | 26a0f5db8425fbcbd20e60c924c61592b2c132a6 (patch) | |
tree | 4ed14c85e34b7301b0a3ea3b44528a782ce5d2f5 | |
parent | effa791c22ef2f944b4621c94150e129fe1af28b (diff) |
DVB (2390): Adds a time-delay to IR remote button presses for av7110 ir input,
- Adds a time-delay to IR remote button presses for av7110_ir input,
such that it acts more like a keyboard. A short press will be treated
as a single button press. Holding down a button on the remote will
respond like holding down a key on the keyboard, and result in a
key-repeat. This just introduces a delay between the 1st press, and
going into key-repeat so that it is possible to get a single 'up'.
Signed-off-by: Noone Important <nxhxzi702 at sneakemail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_ir.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index f5e59fc924af..9138132ad25f 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c | |||
@@ -17,6 +17,8 @@ static int av_cnt; | |||
17 | static struct av7110 *av_list[4]; | 17 | static struct av7110 *av_list[4]; |
18 | static struct input_dev *input_dev; | 18 | static struct input_dev *input_dev; |
19 | 19 | ||
20 | static u8 delay_timer_finished; | ||
21 | |||
20 | static u16 key_map [256] = { | 22 | static u16 key_map [256] = { |
21 | KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, | 23 | KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, |
22 | KEY_8, KEY_9, KEY_BACK, 0, KEY_POWER, KEY_MUTE, 0, KEY_INFO, | 24 | KEY_8, KEY_9, KEY_BACK, 0, KEY_POWER, KEY_MUTE, 0, KEY_INFO, |
@@ -112,13 +114,16 @@ static void av7110_emit_key(unsigned long parm) | |||
112 | if (timer_pending(&keyup_timer)) { | 114 | if (timer_pending(&keyup_timer)) { |
113 | del_timer(&keyup_timer); | 115 | del_timer(&keyup_timer); |
114 | if (keyup_timer.data != keycode || new_toggle != old_toggle) { | 116 | if (keyup_timer.data != keycode || new_toggle != old_toggle) { |
117 | delay_timer_finished = 0; | ||
115 | input_event(input_dev, EV_KEY, keyup_timer.data, !!0); | 118 | input_event(input_dev, EV_KEY, keyup_timer.data, !!0); |
116 | input_event(input_dev, EV_KEY, keycode, !0); | 119 | input_event(input_dev, EV_KEY, keycode, !0); |
117 | } else | 120 | } else |
118 | input_event(input_dev, EV_KEY, keycode, 2); | 121 | if (delay_timer_finished) |
119 | 122 | input_event(input_dev, EV_KEY, keycode, 2); | |
120 | } else | 123 | } else { |
124 | delay_timer_finished = 0; | ||
121 | input_event(input_dev, EV_KEY, keycode, !0); | 125 | input_event(input_dev, EV_KEY, keycode, !0); |
126 | } | ||
122 | 127 | ||
123 | keyup_timer.expires = jiffies + UP_TIMEOUT; | 128 | keyup_timer.expires = jiffies + UP_TIMEOUT; |
124 | keyup_timer.data = keycode; | 129 | keyup_timer.data = keycode; |
@@ -145,7 +150,8 @@ static void input_register_keys(void) | |||
145 | 150 | ||
146 | static void input_repeat_key(unsigned long data) | 151 | static void input_repeat_key(unsigned long data) |
147 | { | 152 | { |
148 | /* dummy routine to disable autorepeat in the input driver */ | 153 | /* called by the input driver after rep[REP_DELAY] ms */ |
154 | delay_timer_finished = 1; | ||
149 | } | 155 | } |
150 | 156 | ||
151 | 157 | ||