From: Bastien Nocera <hadess@hadess.net>
To: linux-input@vger.kernel.org
Subject: EVIOCGKEYCODE_V2 not working for a specific driver?
Date: Wed, 27 Jan 2021 17:28:12 +0100 [thread overview]
Message-ID: <86f1ab110d0fb31fd308d38ad801a0b87df54c17.camel@hadess.net> (raw)
Hey,
I was trying to figure out, for remotes like the one supported by the
hid-creative-sb0540 driver, what needed to be done to allow keys to be
remapped, especially the ones that don't have a mapping by default.
I think that the keymap is setup correctly in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-creative-sb0540.c#n194
and pressing buttons emits events with the correct keycodes.
But using EVIOCGKEYCODE or EVIOCGKEYCODE_V2 always gives me "0" as the
keycode for all the scancodes it can go through.
I also tried evmap:
https://github.com/vovcat/evmap/
and this manages to extract 257 keys, from 00, to ff, inclusive:
sudo ./evmap -d /dev/input/event20 -p
[sudo] password for hadess:
index scancode keycode name
0 ff000000 0 RESERVED
1 ff000000 0 RESERVED
2 ff000001 0 RESERVED
3 ff000002 0 RESERVED
4 ff000003 0 RESERVED
5 ff000004 0 RESERVED
6 ff000005 0 RESERVED
7 ff000006 0 RESERVED
<snip>
256 ff0000ff 0 RESERVED
I tried reading through input.c's handling of the input_get_keycode()
and associated, and can't figure out what's wrong here.
Any ideas?
Cheers
reply other threads:[~2021-01-27 16:29 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=86f1ab110d0fb31fd308d38ad801a0b87df54c17.camel@hadess.net \
--to=hadess@hadess.net \
--cc=linux-input@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).