Reputation: 2978
Is it possible to override Excel keyboard shortcuts inside a custom task pane?
For instance I would like to capture the shortcut Ctrl+Space, but Excel already uses that shortcut inside a custom task pane, and the shortcut never reaches the KeyPressed event handler on my user control.
Other key combinations that Excel doesn't use reach my event handler just fine.
Is there a way to override this, maybe via the Windows API?
Upvotes: 0
Views: 332
Reputation: 49395
You can use the SetWindowsHookEx function from Windows API to set up a keyboard hook. But overriding the built-in keyboard shortcut is not a good idea. Anyway, you can read more about this and find a sample code in the Using shortcut keys to call a function in an Office Add-in article.
Upvotes: 1