User Activity

I'm using 'stm32f103rc'.I connected the button to the GPIO PIN.If the button is still pressed, the HIGH signal will continue to occur.So, how do you detect how long the HIGH signal has been pressed?Because when the button is pressed for more than 0.5...
I'm using 'STM32F103RCT' and been create a HID Custom keyboard.When the HID Keyboard disconnects from the computer, is there a function that occurs?
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...