Skip to content

Commit 71be9d3

Browse files
committed
Ignore diagonals for iMON PAD in keyboard mode
For user with an iMON PAD Remote control, the keyboard mode is very touchy and almost useless with XBMC. Event with stabilized() algorithm the behaviour is unexpected. To make it less touchy, I make it ignore any value too close to the diagonals.
1 parent 0ecfebd commit 71be9d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/media/rc/imon.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,17 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
14591459
buf[3] = (dir >> 8) & 0xFF;
14601460
scancode = be32_to_cpu(*((__be32 *)buf));
14611461
} else {
1462+
/*
1463+
* For users without stabilized, just ignore any value getting
1464+
* to close to the diagonal.
1465+
*/
1466+
if ((abs(rel_y) < 2 && abs(rel_x) < 2) ||
1467+
abs(abs(rel_y) - abs(rel_x)) < 2 ) {
1468+
spin_lock_irqsave(&ictx->kc_lock, flags);
1469+
ictx->kc = KEY_UNKNOWN;
1470+
spin_unlock_irqrestore(&ictx->kc_lock, flags);
1471+
return;
1472+
}
14621473
/*
14631474
* Hack alert: instead of using keycodes, we have
14641475
* to use hard-coded scancodes here...

0 commit comments

Comments
 (0)