From: Antonio Cuni <cuni@programmazione.it>
To: vojtech@suse.cz
Cc: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] Chicony USB Keyboard
Date: Wed, 12 May 2004 23:13:53 +0200 [thread overview]
Message-ID: <200405122313.53549.cuni@programmazione.it> (raw)
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]
Hi,
I've got a Chicony KU-0108 USB keyboard with some multimedial keys: most of
them works fine, but there is no chance to use the 'cut', 'copy' and 'paste'
keys with the official kernels: the problem is that the keyboard reports
strange usages for those keys, so I write a little patch that fixes the bug.
This patch (against 2.6.6) modifies the hidinput_configure_usage function in
drivers/usb/input/hid-input.c: it checks for the usages reported by the
keyboard and fixes the values so that they can be seen as "standard" keys.
Comments are appreciated
[I've subscribed only linux-usb-devel, so plese CC replies from linux-kernel]
cheers,
Antonio
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 924 bytes --]
--- drivers/usb/input/hid-input.c.orig 2004-04-25 10:23:49.000000000 +0200
+++ drivers/usb/input/hid-input.c 2004-04-25 10:32:54.000000000 +0200
@@ -122,6 +122,22 @@ static void hidinput_configure_usage(str
case HID_GD_GAMEPAD: usage->code += 0x10;
case HID_GD_JOYSTICK: usage->code += 0x10;
case HID_GD_MOUSE: usage->code += 0x10; break;
+
+ case 0x000C0003:
+ /* reported on a Chicony KU-0108 USB Keyboard.
+ * The 'cut', 'copy' and 'paste' keys are seen as
+ * HID_UP_BUTTON instead of, e.g.,
+ * HID_UP_CONSUMER. The keys report a keycode > 255,
+ * so we need to fix it.
+ */
+
+ switch (usage->code) {
+ case 0x10f: usage->code = KEY_CUT; break;
+ case 0x100: usage->code = KEY_COPY; break;
+ case 0x101: usage->code = KEY_PASTE; break;
+ }
+ break;
+
default:
if (field->physical == HID_GD_POINTER)
usage->code += 0x10;
reply other threads:[~2004-05-12 21:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200405122313.53549.cuni@programmazione.it \
--to=cuni@programmazione.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=vojtech@suse.cz \
/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
all inboxes | Powered by JetHome®