How to check the Caps/Num Lock state?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kedv
:warning: Old Version Published before Godot 3 was released.

I’am writing a typing app and I need to warn the user when Caps- or Num- Lock key is active or not. How can I show the Caps Lock state via GDScript?

I don’t think it’s possible. Are you trying to rewrite a text input system?

Zylann | 2017-05-03 23:14

No, I have not try to rewrite the input system. I take a look on these.

The only way I see at the moment is to react to the caps lock key and show a warning sign, but when the applikation starts with caps lock enabled that’s do not work. :frowning:

kedv | 2017-05-04 08:31

I think the feature is not implemented indeed. You could ask for it by opening an issue on GitHub, it sounds like a good thing to provide in the OS singleton. Something like bool OS::is_caps_lock_enabled().

Akien | 2017-05-04 11:19

Ok, this sounds like a plan.

kedv | 2017-05-05 07:15

There’s a github feature proposal. Log on and give it a thumbs up so that they can prioritize the development. Add a method to check the current keyboard Caps Lock status · Issue #2264 · godotengine/godot-proposals · GitHub

j5E01 | 2021-09-08 07:27