Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查 CapsLock 或 NumLock 状态并查看它们是启用还是禁用(打开或关闭)?据我搜索,我只知道可以检查它们是否被按下。
您可以使用以下方法在您的页面上查看:
var keystate = Window.Current.CoreWindow.GetKeyState(VirtualKey.NumberKeyLock); var isNumLocked = (keystate & CoreVirtualKeyStates.Locked) != 0;