public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] Fix too-many-keys-pressed error in hidp/core.c
@ 2005-01-19 22:44 Juha Yrjölä
  2005-01-20  0:19 ` Marcel Holtmann
  0 siblings, 1 reply; 8+ messages in thread
From: Juha Yrjölä @ 2005-01-19 22:44 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Hi,

Attached is a patch which fixes the problem of keys repeating when too many
keys pressed at the same time (e.g. when typing quickly).  This often
results in "mount" becoming "mouount". =)

It seems that the BT keyboard sends a HID report with the keys all set to
0x01 if too many keys were pressed at the same time.  This confused the
previous report handling logic.

Verified working on a Logitech diNovo keyboard.

Signed-off-by: Juha Yrjölä <juha.yrjola@iki.fi>

Oh yeah, the patch is against 2.6.10-mh1.

Cheers,
Juha

[-- Attachment #2: too-many-keys-patch.diff --]
[-- Type: text/plain, Size: 600 bytes --]

--- net/bluetooth/hidp/core.c.old	2005-01-20 00:08:05.000000000 +0200
+++ net/bluetooth/hidp/core.c	2005-01-20 00:32:18.000000000 +0200
@@ -175,6 +175,15 @@
 		for (i = 0; i < 8; i++)
 			input_report_key(dev, hidp_keycode[i + 224], (udata[0] >> i) & 1);
 
+		/* If all the key codes have been set to 0x01, it means
+		 * too many keys were pressed at the same time */
+		for (i = 2; i < 8; i++) {
+			if (udata[i] != 0x01)
+				break;
+		}
+		if (i == 8)
+			break;
+
 		for (i = 2; i < 8; i++) {
 			if (keys[i] > 3 && memscan(udata + 2, keys[i], 6) == udata + 8) {
 				if (hidp_keycode[keys[i]])

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

end of thread, other threads:[~2005-01-23 12:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-19 22:44 [Bluez-devel] [PATCH] Fix too-many-keys-pressed error in hidp/core.c Juha Yrjölä
2005-01-20  0:19 ` Marcel Holtmann
2005-01-20  0:34   ` Juha Yrjölä
2005-01-20  1:01     ` Marcel Holtmann
2005-01-20  9:03       ` Juha Yrjölä
2005-01-23  8:46         ` Marcel Holtmann
2005-01-23 11:39           ` Juha Yrjölä
2005-01-23 12:01             ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox