就好像 ALT 没有释放一样 - 使用快捷键/Alt+组合键
我的 .net (C#) GUI 将 Alt+n 和 Alt+a 定义为快捷方式(例如,两个名为“&Add”和“&Notes”的按钮)。
问题是,当用户单击 Alt+n 并执行相应的代码后,“ALT”似乎仍处于“按下”模式。如果用户现在仅单击“a”字符(而不是“Alt+a”组合),则“Alt+a”组合的代码仍然会执行。
在“Alt+n”之后按“ESC”将会释放“ALT”,这是一种奇怪的行为。之后按“a”将不再具有“Alt+a”效果。
为什么会发生这种情况? 我怎样才能防止这种情况发生?
谢谢 !
注意:显然 Alt+a 和 Alt+n 只是示例。无论使用什么热键都会发生这种情况。
My .net (C#) GUI has both Alt+n and Alt+a defined as shortcuts(E.g. two buttons named "&Add" and "&Notes").
The problem is that after the user clicks Alt+n and the corresponding code executes, then it seems that "ALT" is still in "pressed" mode. If the user will now click only the "a" character (not the "Alt+a" combination) still the code for the "Alt+a" combination will execute.
Pressing "ESC" after the "Alt+n" will release the "ALT from it's weird behavior. Afterwards pressing "a" will not have that "Alt+a" effect anymore.
Why is this happening ?
How can I prevent this ?
Thanks !
Note: obviously Alt+a and Alt+n are only examples. this happens with whatever hotkey.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您仅按 Alt 键时,您的按钮是否显示带下划线的“A”和“N”?可能和你的windows设置有关。转到“控制面板\轻松访问\轻松访问中心\使键盘更易于使用”并在那里尝试不同的设置。
When you press only Alt key, does your buttons show "A" and "N" underlined? It could be related to your windows settings. Go to "Control Panel\Ease of Access\Ease of Access Center\Make the keyboard easier to use" and try different settings there.