Background:
I want to listen to a sequence of hot keys ( Ctrl+Alt+Left ) around the world, so I use:
[DllImport("user32.dll")] private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
This works great with many other keyboard shortcuts like Ctrl+Alt+PageUp , Ctrl+Alt+PageDown , etc. But the problem arises with Ctrl+Alt+Left , in particular.
Problem:
It works fine on one computer, like any other hotkey sequence, but on another computer, where Ctrl+Alt+Arrow used to rotate the screen, it cannot register a hotkey (i.e. returns zero and doesnβt get callbacks to the window handle).
MSDN says: RegisterHotKey fails if the keys pressed for the hotkey are already registered with another hotkey.
I would like to be able to register this hotkey sequence, no matter what and if necessary, override it. Of course, I would like the screen to remain without support, at least as long as my program works.
Changing the hotkey sequence is not really an option, as other computers may have different hotkey sequences, which can also cause a crash.
Questions:
What is the difference between Ctrl+Alt+Left as a hotkey for the screen and Ctrl+S as a save hotkey, the reasons for the failure, but not others? (perhaps this is because one of them is a global hotkey, and the second is a shortcut?)
Is it possible to completely override hotkeys? Is that a good idea?
Most importantly, how can I assure that my hotkey will be registered?