Skip to contentSkip to conversation

USB Keypad

DISCUSSION [email protected] 2 participants 3 messages Jul 7 USB

lore
Share & tools
lore
#0 lore raw

Excuse me. I have never sent e-mail to the Linux Kernel mailing list before. In reading the protocol, I think I should have sent my message to this one, instead.

Hello,
I am working on a mobile device based on Raspberry Pi OS. I am using
a USB keypad to navigate the UI of my device. I have purchased 2 models. One has 19 keys and the other has a few more. I've implemented the user-space code to read() the input device. Things are generally working fine. But I have one issue. On both models the keycodes I receive are not unique across all keys. On one, the key labeled INS and the one labeled 0 both send the same code. On the second one, the mapping is even more bizarre. It has duplicated Num Locks and other keys, as well. The number keys are always readable as such, but the other non-number keys can be aliased.
My question is simple: is there something I need to do to change the
mode of the keypad to send unique codes? Perhaps an ioctl()? I do not know the HID spec. I wonder what pressing the Num Lock key causes an OS (like Windows) or X11 to do to change keypad modes. Is there a document or website I can read that discusses this?
Thank you,
David

#1 lore raw
Quoted 4 lines · On Mon, Jul 06, 2026 at 08:08:01PM -0700, [email protected] wrote:

Excuse me. I have never sent e-mail to the Linux Kernel mailing list before. In reading the protocol, I think I should have sent my message to this one, instead.

Quoted 8 lines

Hello,
I am working on a mobile device based on Raspberry Pi OS. I am using
a USB keypad to navigate the UI of my device. I have purchased 2 models. One has 19 keys and the other has a few more. I've implemented the user-space code to read() the input device. Things are generally working fine. But I have one issue. On both models the keycodes I receive are not unique across all keys. On one, the key labeled INS and the one labeled 0 both send the same code.

That sounds like a broken device, not much the kernel can do about that.

Can you confirm this by looking at the keycodes when plugging the device into any other "normal" Linux system?

Quoted 3 lines

On the second one, the mapping is even more bizarre. It has duplicated Num Locks and other keys, as well. The number keys are always readable as such, but the other non-number keys can be aliased.

Again, is this keyboard issue? Do they work properly anywhere else?

thanks,

greg k-h

#2 lore raw

Greg,
Wisdom, indeed. I just disconnected the keypad from the Pi and
connected it to my Windows laptop. When I brought up an editor I was able to demonstrate exactly the same mappings. No, it is not the kernel. This appears to be the device, itself. Thank you for the debug suggestion. I should have thought of it.
Thanks,
David

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Monday, July 6, 2026 9:30 PM
To: [email protected]
Cc: [email protected]
Subject: Re: USB Keypad

Quoted 1 line · On Mon, Jul 06, 2026 at 08:08:01PM -0700, [email protected] wrote:

Excuse me. I have never sent e-mail to the Linux Kernel mailing list

before.

Quoted 6 lines

In reading the protocol, I think I should have sent my message to this one, instead.

Hello,
I am working on a mobile device based on Raspberry Pi OS. I am using

Quoted 6 lines

a USB keypad to navigate the UI of my device. I have purchased 2 models. One has 19 keys and the other has a few more. I've implemented the user-space code to read() the input device. Things are generally working fine. But I have one issue. On both models the keycodes I receive are not unique across all keys. On one, the key labeled INS and the one labeled 0 both send the same code.

That sounds like a broken device, not much the kernel can do about that.

Can you confirm this by looking at the keycodes when plugging the device into any other "normal" Linux system?

Quoted 3 lines

On the second one, the mapping is even more bizarre. It has duplicated Num Locks and other keys, as well. The number keys are always readable as such, but the other non-number keys can be aliased.

Again, is this keyboard issue? Do they work properly anywhere else?

thanks,

greg k-h