EspTinyUSB icon indicating copy to clipboard operation
EspTinyUSB copied to clipboard

Media Key Support?

Open Hard-n-Soft opened this issue 3 years ago • 6 comments

Is there also Media Key support (planned)?

e.g., KEY_MEDIA_NEXT_TRACK , KEY_MEDIA_PLAY_PAUSE, KEY_MEDIA_VOLUME_UP ...

Best regards

Hard-n-Soft avatar Apr 06 '21 13:04 Hard-n-Soft

Hi, it requires different or updated report map descriptor. For example keyboard class or composite class could be extended. Yes, that may be done eventually.

chegewara avatar Apr 06 '21 13:04 chegewara

Do you have a rough idea of ​​when you could bring media key support?

Hard-n-Soft avatar Apr 06 '21 13:04 Hard-n-Soft

Well, this library is not very popular and now its not on top of my list to upgrade. Recently ive been playing with USB host (esp-idf), but temporary it is also on standby.

All depends what you want to achieve, but it is not hard to do it. Start with this class and for example replace mouse: https://github.com/chegewara/EspTinyUSB/blob/master/src/classes/hid/hidcomposite.cpp#L17-L20

here is example how it is done in tinyusb: https://github.com/hathach/tinyusb/blob/master/examples/device/hid_composite/src/usb_descriptors.c#L74-L80

chegewara avatar Apr 06 '21 14:04 chegewara

Thanks for your support. But I'm a rooky. Do you have an easy example how to send the Media Key Message with the "Lib" hidcomposite.cpp?

Hard-n-Soft avatar Apr 06 '21 15:04 Hard-n-Soft

No, and hidcomposite.cpp is not ready to send media keys. You would need to update library/class code to do it.

chegewara avatar Apr 06 '21 15:04 chegewara

Hi chegewara,

may you help me in another direction. I need in one ESP32 application Mouse, Keyboard and Media Key support. I found the following libraries - but non off them supports all.

  1. The base from 2. and 3. from T-vK: Only support mouse OR Keyboard+Media in the same Arduino sketch
  2. Blackketter, based on T-vK: Mouse AND Keyboard support, but no Media Keys --> Fixed Mouse reconnection
  3. Jakern, based on T-vK/Blackketter: Mouse+Keyboard+Media --> But problems with Mouse reconnection I tried to combine the two libraries, see, in general it is working. But by changing Keyboard.write( KEY_MEDIA_VOLUME_UP ); or Keyboard.write( KEY_MEDIA_VOLUME_DOWN ); strage PC/Windows behaviour - seems to block timewise Win message system.

Do you have any idea. I seems, that all of the stuff before is based on your great experience, Best regards

Hard-n-Soft avatar Apr 10 '21 09:04 Hard-n-Soft