On Windows, how can I block a key combination like Alt+F2+F8. Note that I have two base keys (F2 and F8) in it. Usually you can only block key combinations with one base key and up to three modifiers (Shift, Ctrl, Win).
With a small utility called KeyCodes I monitored what Windows sees when holding down Alt+F2+F8.
No surprise here.
I already tried AutoIt's function HotKeySet
, but unfortunately...
The following hotkeys cannot be set:
[...]
Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.
Q: How can I block a key combination containing two base keys
Alt-F2
it sees it, if the user pressesAlt-F8
it sees that too, but if user pressesAlt-F2-F8
it sees neither? Unfortunately the user won't pressF2
andF8
exactly simultaneously and even if they did, the system will process them sequentially anyway. So at some moment there will be justAlt-F2
or justAlt-F8
and they'll take effect...In rare cases, its possible that a user presses Alt+F2+F8.
That’s your problem; you are trying to “fix” user error. There are plenty of keys that could cause undesired behavior when used incorrectly, e.g.,Del
,Esc
,Alt
+F4
, but you don’t see people running out to find a way to prevent those from working. Unless people are pressingAlt
+F2
+F8
frequently for some reason, then the unwanted behavior is just a way to reinforce learning to be more careful about what they press.