Keyboard sensor CAPS LOCK

Hey, i wanted to start messing with implementing some typing into my project until
i bumped into a problem and found out that Keyboard sensor is not responding to CAPS LOCK
input which completely screws everything i was about to do.

Any ideas how can i fix it?
Could it be something to do with that i just bought Logitech K120 keyboard
and plugged it in via USB without installing its drivers possibly?


Many thanks in advance.


I googled it. First result:

First answer says:

def get_capslock_state():
    import ctypes
    hllDll = ctypes.WinDLL ("User32.dll")
    VK_CAPITAL = 0x14
    return hllDll.GetKeyState(VK_CAPITAL)

And someone else posted how to do the same thing on linux on the other thread, not that google couldn’t also spill out a similar answer.

Now we know whether the led is on or off, all that remains is upper casing the input.

s = input.upper() if allcaps else input;

That’s about it.

you are making assumptions here.
another scenario is to warn the user that CAPS LOCK is on.

Ah yes, the grave dangers of upper case letters.

that is not the point, the point is that you can not know why someone would want to know a state on some key, and what someone is going to use it for.

We are men of science, not fortune tellers. He must narrow down the question if he wants a more precise answer.

i think he got his answer, that the blender game engine have limited keyboard functionality.

You cannot represent everything that is possible to do inside the GUI of Blender - it is already packed full of buttons. The logic bricks are designed to be a simpler (and visual) way to do things, and that means not including literally everything you can do. The line has to be drawn somewhere. If OP wants more control, then they can learn Python to get it.

i was not only talking about the GUI when i wrote that.