Chris Jones wrote:
Does anyone know how I can control the repeat rate of my ATi Remote Bob (which appears as a regular keyboard in /dev/input)? It's a great remote, but at the moment (Ubuntu Dapper) I basically can't use it because each button press prodces 4 or 5 events, so I can't use the OSD.
is this an x10 remote using the kernel ati_remote driver? if yes, you can try the attached patch. A Medion remote i have was unusable w/o this change; eg. pressing the same key twice resulted in six events: one for the first key press and five for the second. Switching to channel '11' or moving two lines down triggers this... With the patch the (pseudo-)auto-repeat rate goes down 5x, but the remote becomes usable. I don't have any ati remotes so i can't tell if this problem affects them. (the patch also adds some extra keycodes for the medion remote)
artur
--- v2.6.17/drivers/usb/input/ati_remote.c 2006-06-20 17:16:36.000000000 +0000 +++ v2.6.17-dtnode/drivers/usb/input/ati_remote.c 2006-06-27 10:00:10.000000000 +0000 @@ -156,8 +156,9 @@ static const char accel[] = { 1, 2, 4, 6 * and we have to take this into account for an accurate repeat * behaviour. * (HZ / 20) == 50 ms and works well for me. + * "+ 1" is needed for HZ==250 etc. */ -#define FILTER_TIME (HZ / 20) +#define FILTER_TIME (HZ/20 + 1)
struct ati_remote { struct input_dev *idev; @@ -277,6 +278,21 @@ static const struct { {KIND_FILTERED, 0xf4, 0x2F, EV_KEY, KEY_END, 1}, /* END */ {KIND_FILTERED, 0xf5, 0x30, EV_KEY, KEY_SELECT, 1}, /* SELECT */
+ /* Medion remote keys */ + {KIND_FILTERED, 0xf1, 0x2c, EV_KEY, KEY_TV, 1}, /* TV */ + {KIND_FILTERED, 0xf6, 0x31, EV_KEY, KEY_VIDEO, 1}, /* (VIDEO DESKTOP) */ + + {KIND_FILTERED, 0xf7, 0x32, EV_KEY, KEY_RED, 1}, /* <RED> */ + {KIND_FILTERED, 0xf8, 0x33, EV_KEY, KEY_GREEN, 1}, /* <GREEN> */ + {KIND_FILTERED, 0xf9, 0x34, EV_KEY, KEY_YELLOW, 1}, /* <YELLOW> */ + {KIND_FILTERED, 0xfa, 0x35, EV_KEY, KEY_BLUE, 1}, /* <BLUE> */ + + {KIND_FILTERED, 0xfb, 0x36, EV_KEY, KEY_MOVE, 1}, /* RENAME */ + {KIND_FILTERED, 0xfc, 0x37, EV_KEY, KEY_NEW, 1}, /* ACQUIRE IMAGE */ + {KIND_FILTERED, 0xfd, 0x38, EV_KEY, KEY_EDIT, 1}, /* EDIT */ + {KIND_FILTERED, 0xfe, 0x39, EV_KEY, KEY_SCREEN, 1}, /* FULL SCREEN */ + {KIND_FILTERED, 0xff, 0x3a, EV_KEY, KEY_AUDIO, 1}, /* DVD AUDIO */ + {KIND_END, 0x00, 0x00, EV_MAX + 1, 0, 0} };
@@ -480,6 +496,8 @@ static void ati_remote_input_report(stru ati_remote->old_data[1] = data[2]; ati_remote->old_jiffies = jiffies;
+ if (ati_remote->repeat_count > 4) + ati_remote->repeat_count = 0; if ((ati_remote->repeat_count > 0) && (ati_remote->repeat_count < 5)) return;