UWP - How to check NumLock and CapsLock status?

654 Views Asked by At

How can check for CapsLock or NumLock status and see if they are enabled or disabled (on or off)? As far as I searched, I know only it's possible to check if they are pressed.

1

There are 1 best solutions below

0
Thomas Schneiter On BEST ANSWER

You can check it on your Page using:

var keystate = Window.Current.CoreWindow.GetKeyState(VirtualKey.NumberKeyLock);
var isNumLocked = (keystate & CoreVirtualKeyStates.Locked) != 0;