简体   繁体   中英

As if ALT doesn't get released - using shortcut keys / Alt+key combination

My .net (C#) GUI has both Alt+n and Alt+a defined as shortcuts(Eg 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM