Skip to main content
Visitor II
November 20, 2020
Solved

Is there a way to read the state of the computer? (HID Keyboard)

  • November 20, 2020
  • 1 reply
  • 736 views

I'm using 'STM32F103RCT' and been create a HID Custom keyboard.

I want to know the states of 'Num Lock', 'Insert' and 'Caps Lock' etc on the HID keyboard's computer.

Because it has to be checked with LED.

lighting the LED is essential when connecting to the computer.

How do I know the state of the computer?

Reading the computer's state is the difficult problem.

    This topic has been closed for replies.
    Best answer by Pavel A.

    A keyboard does not "read" the host's (computer) Num lock etc. states.

    Rather, the computer requests the keyboard to set its LEDs on/off.

    The keyboard should advertise the LEDs capability in its HID report descriptor and should handle the host's requests properly.

    -- pa

    1 reply

    Pavel A.Answer
    Super User
    November 21, 2020

    A keyboard does not "read" the host's (computer) Num lock etc. states.

    Rather, the computer requests the keyboard to set its LEDs on/off.

    The keyboard should advertise the LEDs capability in its HID report descriptor and should handle the host's requests properly.

    -- pa