public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Juha Yrjölä" <juha.yrjola@iki.fi>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [PATCH] Fix too-many-keys-pressed error in hidp/core.c
Date: Thu, 20 Jan 2005 00:44:00 +0200	[thread overview]
Message-ID: <20050119224400.GA7881@salvia.homeip.net> (raw)

[-- 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]])

             reply	other threads:[~2005-01-19 22:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 22:44 Juha Yrjölä [this message]
2005-01-20  0:19 ` [Bluez-devel] [PATCH] Fix too-many-keys-pressed error in hidp/core.c 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050119224400.GA7881@salvia.homeip.net \
    --to=juha.yrjola@iki.fi \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox