linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* EVIOCGKEYCODE_V2 not working for a specific driver?
@ 2021-01-27 16:28 Bastien Nocera
  0 siblings, 0 replies; only message in thread
From: Bastien Nocera @ 2021-01-27 16:28 UTC (permalink / raw)
  To: linux-input

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-27 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 16:28 EVIOCGKEYCODE_V2 not working for a specific driver? Bastien Nocera

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).