sekigon-gonnoc / qmk_firmware

keyboard controller firmware for Atmel AVR and ARM USB families
http://qmk.fm
GNU General Public License v2.0
208 stars 84 forks source link

the KC_AUDIO_VOL_DOWN and KC_AUDIO_VOL_UP not work when using the encoder in the usb model. #34

Closed jiaxin96 closed 4 years ago

jiaxin96 commented 4 years ago

https://github.com/sekigon-gonnoc/qmk_firmware/blob/0d9072bb4786393307fcb48ce0b3379af179db77/tmk_core/protocol/nrf/sdk15/usbd.c#L820

I set the EXTRAKEY_ENABLE = yes, and the KC_AUDIO_VOL_UP and KC_AUDIO_VOL_DOWN work in the ble model but not the usb model when i use an encoder, and i find the problem is in the function usbd.c#L820, but i can't solve it.

jiaxin96 commented 4 years ago

image I think that the problem maybe in the definition of the usb_hid_report.

jiaxin96 commented 4 years ago

It is more clear that: in the usb mode, the 'register_code' and 'unregister_code' functions cannot work, that is, the 'usbd_send_consumer' cannot be used normally. But when I set the media key in the keymaps, it is valid. When I directly call 'register_code' or 'usbd_send_consumer', it is invalid. In the ble mode, all things are ok.