I'm trying to put a flyout warning if CapsLock button is On while typing something in PasswordBox.
I'm NOT trying to find out if the pressed key is CapsLock
I checked out the old,
KeyboardDevice .NET 3.5
Control.IsKeyLocked() Windows Forms
Console.CapsLock Not Available in Windows 8.1 Store Application
Keyboard.GetKeyStates Not Available in Windows 8.1 Store Application
and WinApi Style calls.
None of them seems suitable, Anyone has a suggestion
Try CoreWindow.GetAsyncKeyState with a value of VirtualKey.CapitalLock
.
You can get the current CoreWindow
with CoreWindow.GetForCurrentThread.
Additionally, you can subscribe to the CoreWindow.KeyDown and CoreWindow.KeyUp events to update your key status indicator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With