keycode icon indicating copy to clipboard operation
keycode copied to clipboard

Arrow key information not showing from HID

Open lonnietc opened this issue 3 years ago • 1 comments

Hello,

I am trying to learn about USB keyboard and mouse drivers for an OS project that I am working on now and your keycode might be what I am needing so that I can learn an implement it since the current keyboard driver that I have in the OS is an old PS/2 driver and I need to replace it.

In any case, I ran your code on my Linux machine (Ubuntu 20.04) but then I tried to get the HID codes for the arrow-keys it only displayed 0x00

I think that it has to do with the keyboard mapping that your "x11_test" program is using, but I am not really sure.

Also, when I run the test/id_test program, it does not give an type of information.

Am I missing something here?

lonnietc avatar Feb 23 '22 23:02 lonnietc

id_test is a unit test, it will print an error message if it fails. I can add documentation that explains this.

When I run x11_test on Linux and press the arrow keys, I get:

$ ./x11_test
Key Press:
Key press:
  X11 Keycode: 0x67 (UP)
  HID Keycode: 0x52 (Up)
Key Press:
Key press:
  X11 Keycode: 0x6c (DOWN)
  HID Keycode: 0x51 (Down)
Key Press:
Key press:
  X11 Keycode: 0x69 (LEFT)
  HID Keycode: 0x50 (Left)
Key Press:
Key press:
  X11 Keycode: 0x6a (RIGHT)
  HID Keycode: 0x4f (Right)

I'm going to check if x11_test is getting the PS/2 scancodes correctly (which is what Linux uses), or if it's getting something else.

depp avatar May 11 '22 23:05 depp