Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS / Keyboard: could not open device #484

Closed
real-felix opened this issue Oct 11, 2023 · 4 comments
Closed

MacOS / Keyboard: could not open device #484

real-felix opened this issue Oct 11, 2023 · 4 comments

Comments

@real-felix
Copy link

Hello, I'm writing a keyboard firmware, and I'm debugging the official one to see how it works. For some reason, it yields 5 entrie:

% ./hidapitester --vidpid 3297/1969 --list-detail
3297/1969: ZSA Technology Labs - Moonlander Mark I
  vendorId:      0x3297
  productId:     0x1969
  usagePage:     0xFF60
  usage:         0x0061
  serial_number:  
  interface:     1 
  path: DevSrvsID:4295052728

3297/1969: ZSA Technology Labs - Moonlander Mark I
  vendorId:      0x3297
  productId:     0x1969
  usagePage:     0x0001
  usage:         0x0006
  serial_number:  
  interface:     0 
  path: DevSrvsID:4295052723

3297/1969: ZSA Technology Labs - Moonlander Mark I
  vendorId:      0x3297
  productId:     0x1969
  usagePage:     0x0001
  usage:         0x0080
  serial_number:  
  interface:     2 
  path: DevSrvsID:4295052727

3297/1969: ZSA Technology Labs - Moonlander Mark I
  vendorId:      0x3297
  productId:     0x1969
  usagePage:     0x000C
  usage:         0x0001
  serial_number:  
  interface:     2 
  path: DevSrvsID:4295052727

3297/1969: ZSA Technology Labs - Moonlander Mark I
  vendorId:      0x3297
  productId:     0x1969
  usagePage:     0x0001
  usage:         0x0006
  serial_number:  
  interface:     2 
  path: DevSrvsID:4295052727

When I try and listen to the first one, it works correcly:

% sudo ./hidapitester --vidpid 3297/1969 --usagePage 0xFF60 --usage 0x0061  -l 8 --open --read-input-forever
Opening device, vid/pid:0x3297/0x1969, usagePage/usage: FF60/61
Device opened
Reading 8-byte input report 0, 250 msec timeout...read 0 bytes:
…

This obviously isn't the one for the keyboard, because it doesn't react to me pressing a key (always 0 bytes).

I tried opening the 2nd one:

% sudo ./hidapitester -v --vidpid 3297/1969 --usagePage 0x1 --usage 0x6 -l 8 --open --read-input-forever  
Looking for vid/pid 0x3297 / 0x1969  (12951 / 6505)
Set usagePage to 0x0001 (1)
Set usage to 0x0006 (6)
Set buflen to 8
Opening device, vid/pid:0x3297/0x1969, usagePage/usage: 1/6
Error: could not open device
Error on read: no device opened.

But it fails without detail. How can I know what happens here? My goal is to be able to see the keyboard's reports. Thanks by advance!

@Youw
Copy link

Youw commented Oct 11, 2023

You cannot open Keyboard/Mouse devices with HIDAPI on Windows/macOS - operating system doesn't allow that.
If you do want to open a Mouse/Keyboard - you need to use OS API.
The only alternative - detach kernel driver, which is not trivial on macOS in general.

@Youw
Copy link

Youw commented Oct 11, 2023

Oh, and please see #468.

@real-felix
Copy link
Author

Oh, OK, thank you. Maybe you should archived the repo, so that it's obvious it's unmaintained.

@Youw
Copy link

Youw commented Oct 11, 2023

Maybe you should archived the repo

I wish I could.
The only owner of the repo is not answering for years now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants