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

Add support for Keychron K2 (non-RGB) #1

Open
dbolger opened this issue Oct 30, 2023 · 2 comments
Open

Add support for Keychron K2 (non-RGB) #1

dbolger opened this issue Oct 30, 2023 · 2 comments

Comments

@dbolger
Copy link

dbolger commented Oct 30, 2023

I'm interested in using this library, and potentially the Home Assistant integration you've made, but there isn't any support for the K2 device.

I've researched the HID and I've gathered this information:

vendor_id: 1452/0x05ac
product_id: 591/0x24f

device_list = hid.enumerate(vendor_id, product_id)
for device in device_list:
    print(device)

Output:

{'path': b'/dev/hidraw8', 'vendor_id': 1452, 'product_id': 591, 'serial_number': '', 'release_number': 273, 'manufacturer_string': 'Keychron', 'product_string': 'Keychron K2', 'usage_page': 1, 'usage': 6, 'interface_number': 0}
{'path': b'/dev/hidraw9', 'vendor_id': 1452, 'product_id': 591, 'serial_number': '', 'release_number': 273, 'manufacturer_string': 'Keychron', 'product_string': 'Keychron K2', 'usage_page': 12, 'usage': 1, 'interface_number': 1}
{'path': b'/dev/hidraw9', 'vendor_id': 1452, 'product_id': 591, 'serial_number': '', 'release_number': 273, 'manufacturer_string': 'Keychron', 'product_string': 'Keychron K2', 'usage_page': 1, 'usage': 128, 'interface_number': 1}
{'path': b'/dev/hidraw9', 'vendor_id': 1452, 'product_id': 591, 'serial_number': '', 'release_number': 273, 'manufacturer_string': 'Keychron', 'product_string': 'Keychron K2', 'usage_page': 1, 'usage': 6, 'interface_number': 1}

The isConnected example works, but other functions do not work.

@dbolger
Copy link
Author

dbolger commented Oct 30, 2023

From HID Explorer:

productName: Keychron Keychron K2
vendorId:    0x05AC (1452) Apple
productId:   0x024F (591)
opened:      false
collections[0]
  Usage: 000C:0001 (Consumer > Consumer Control)
  Input reports: 0x03
collections[1]
  Usage: 0001:0080 (Generic Desktop > System Control)
collections[2]
  Usage: 0001:0006 (Generic Desktop > Keyboard)
Input report 0x03
  16 bits (bits 0 to 15)
    Data,Ary,Abs
    Usages: 000C:0000 (Consumer usage 0x0000) to 000C:033C (Consumer usage 0x033C)
    Logical bounds: 0 to 828
productName: Keychron Keychron K2
vendorId:    0x05AC (1452) Apple
productId:   0x024F (591)
opened:      false
collections[0]
  Usage: 0001:0006 (Generic Desktop > Keyboard)
  Feature reports: 0x00
Feature report 0x00
  64 values * 8 bits (bits 0 to 511)
    Data,Var,Abs
    Usage: 000C:0000 (Consumer usage 0x0000)
    Logical bounds: -128 to 127

@dbolger
Copy link
Author

dbolger commented Nov 10, 2023

@mishamyrt do you have any advice on how I can add support for my device?

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

1 participant