2019-12-30 06:57 AM
keyboard-pc-usb-stm32
Is it possible to read state of capslock on/off with stm?
Using HAL and cubemx HID configuration.
I can send report. But how to receive report - status?
Solved! Go to Solution.
2019-12-30 10:02 AM
> Is it possible to read state of capslock on/off with stm
No, but this is regardless of whether "with stm" or without. The USB keyboard is completely state-less - it reports which keys are currently pressed, and CAPS LOCK is not different from any other ordinary key. It's the host which has to maintain the CAPS-toggle state, if it implements that at all.
Similarly for LEDs - there is no way to read out the state of LEDs from the keyboard (it even may not implement the LEDs at all). This is even explicitly stated in the standard (HID1.11) in Appendix C:
Synchronization between LED states and CAPS LOCK , NUM L OCK , SCROLL L OCK ,
COMPOSE , and KANA events is maintained by the host and NOT the keyboard
Read the respective USB HID standard documents.
JW
2019-12-30 10:02 AM
> Is it possible to read state of capslock on/off with stm
No, but this is regardless of whether "with stm" or without. The USB keyboard is completely state-less - it reports which keys are currently pressed, and CAPS LOCK is not different from any other ordinary key. It's the host which has to maintain the CAPS-toggle state, if it implements that at all.
Similarly for LEDs - there is no way to read out the state of LEDs from the keyboard (it even may not implement the LEDs at all). This is even explicitly stated in the standard (HID1.11) in Appendix C:
Synchronization between LED states and CAPS LOCK , NUM L OCK , SCROLL L OCK ,
COMPOSE , and KANA events is maintained by the host and NOT the keyboard
Read the respective USB HID standard documents.
JW
2021-11-19 09:03 PM
Actually yes. It is possible to read and write memory from the keyboard LEDs. I just tested it, see the code:
2021-11-19 09:04 PM
Actually yes. It is possible to read and write memory from the keyboard LEDs. I just tested it, see the code: