CharaChorder / CCOS-firmware

CharaChorder Operating System
15 stars 1 forks source link

Enhancement: Media control keys #18

Open rccarlson opened 1 year ago

rccarlson commented 1 year ago

Is your feature request related to a problem? Please describe. Would like to be able to control media via the CC. Inputs such as volume control or media skip/pause/play.

Describe the solution you'd like Added key codes, configurable from charachorder-config.com, or more preferably Dot I/O.

Describe alternatives you've considered No alternative that I'm aware of. This is something that must be supported by the keyboard according to my research. Otherwise, simply out of luck.

jytou commented 1 year ago

To me, this is more a bug than an enhancement, though… these are quite standard these days, and not being able to manipulate volume and play/pause music is a huge regression for me compared to using the keyboard without the CCX.

xslendix commented 6 months ago

NOTE: The way keyboards have those functions is not as keycodes, but as system control functions which are a different descriptor. This would require a new USB descriptor to be implemented into CCOS and special code to act on that for the keys

wkumari commented 5 months ago

Yes, but would require the current descriptor to be modified, but Charachorder X already advertises multiple descriptors. AFAICT, the only "special code" needed would be to simply transparently pass through any "keypresses" (events) which it doesn't recognize.

The current CC X descriptors include:

0x05, 0x01,  0x09, 0x02 [...]     // Generic Desktop Ctrls,  Usage Mouse - Usages: Pointer, X, Y, Wheel, AC Pan.
0x05, 0x01,   0x09, 0x06 [...]     // Generic Desktop Ctrls, Usage Keyboard - Usages: Kbrd/Keypad, LEDs, Kbrd/Keypad 

I think that all that would need to be added is: 0x05, 0x0C, 0x09, 0x01, 0xA1, 0x01 // Usage Page: Consumer, Usage: Consumer Control, Collection: Application [...] The full additional descriptor: 05 0c 09 01 a1 01 85 04 19 01 2a a0 02 15 01 26 a0 02 95 01 75 10 81 00 c0 The current CC X descriptor:

  05  01  09  02  a1  01  85  02  09  01  a1  00  05  09  19  01
  29  05  15  00  25  01  95  05  75  01  81  02  95  01  75  03
  81  01  05  01  09  30  09  31  15  81  25  7f  95  02  75  08
  81  06  09  38  15  81  25  7f  95  01  75  08  81  06  05  0c
  0a  38  02  15  81  25  7f  95  01  75  08  81  06  c0  c0  05
  01  09  06  a1  01  85  01  05  07  19  e0  29  e7  15  00  25
  01  75  01  95  08  81  02  75  08  95  01  81  01  05  08  19
  01  29  05  75  01  95  05  91  02  75  01  95  03  91  01  05
  07  19  00  2a  ff  00  15  00  26  ff  00  75  08  95  0c  81
  00  c0

(146 bytes)

The modified one:

  05  01  09  02  a1  01  85  02  09  01  a1  00  05  09  19  01
  29  05  15  00  25  01  95  05  75  01  81  02  95  01  75  03
  81  01  05  01  09  30  09  31  15  81  25  7f  95  02  75  08
  81  06  09  38  15  81  25  7f  95  01  75  08  81  06  05  0c
  0a  38  02  15  81  25  7f  95  01  75  08  81  06  c0  05  0c
  09  01  a1  01  85  04  19  01  2a  a0  02  15  01  26  a0  02
  95  01  75  10  81  00  c0  c0  05  01  09  06  a1  01  85  01
  05  07  19  e0  29  e7  15  00  25  01  75  01  95  08  81  02
  75  08  95  01  81  01  05  08  19  01  29  05  75  01  95  05
  91  02  75  01  95  03  91  01  05  07  19  00  2a  ff  00  15
  00  26  ff  00  75  08  95  0c  81  00  c0

(171 bytes)