adafruit / Adafruit_CircuitPython_HID

USB Human Interface Device drivers.
MIT License
377 stars 105 forks source link

Fn Key Support #92

Closed edm00se closed 2 years ago

edm00se commented 2 years ago

I'd like to be able to emit the media control key press for macOS, such as pause/play Fn + F7. From my looking through adafruit_hid.keycode and documentation I don't currently believe this is supported but I'd love to see it made available.

Neradoc commented 2 years ago

Media keys are Consumer Controls. There is a short list available in the library: https://docs.circuitpython.org/projects/hid/en/latest/api.html#adafruit-hid-consumer-control-code-consumercontrolcode And you can supply any additional valid value as ints if not in the list.

Here is the example code for ConsumerControl: https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/main/examples/hid_consumer_control_brightness.py

edm00se commented 2 years ago

Perfect! I'll need to re-work my macro but I think that example should get me headed in the right direction. Thank you @Neradoc.