I have a borderless window and created the chrome but I need to disable the 'Alt+Space' shortcut. Any thoughts?
Asked
Active
Viewed 6,350 times
5
-
Keep in mind that it's very bad practise to disable system shortcuts. I would personally uninstall an application that tried to mess with Alt-Space. Just an FYI. – Richard Szalay Jun 02 '10 at 13:20
-
Thanks Richard but I was handling system shortcut to implement it myself. Same keys, added functionality. – Brad Jun 03 '10 at 19:00
1 Answers
9
I'm not very good with WPF, but after some messing around, this seems to be on the right track. Just throw it in your Window code-behind:
protected override void OnKeyDown(KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Alt && e.SystemKey == Key.Space)
{
e.Handled = true;
}
else
{
base.OnKeyDown(e);
}
}

Cᴏʀʏ
- 105,112
- 20
- 162
- 194
-
Thanks Cory. I just spent 6 hours sizing and moving a borderless form with KeyDown (arrows & Ctrl, etc). You'd think this would occur to me?!? :-) Thanks again. – Brad Feb 17 '10 at 00:05