InputWidget now clears on Escape

This commit is contained in:
kylethomson 2011-02-20 03:06:06 +00:00
parent 1a00047b7e
commit bb10d36b73
1 changed files with 14 additions and 6 deletions

View File

@ -32,12 +32,20 @@ namespace BizHawk.MultiClient
if (e.KeyCode == Keys.ControlKey) return; if (e.KeyCode == Keys.ControlKey) return;
if (e.KeyCode == Keys.ShiftKey) return; if (e.KeyCode == Keys.ShiftKey) return;
if (e.KeyCode == Keys.Menu) return; if (e.KeyCode == Keys.Menu) return;
KeyboardBinding kb = new KeyboardBinding(); if (e.KeyCode != Keys.Escape)
kb.key = e.KeyCode; {
kb.modifiers = e.Modifiers; KeyboardBinding kb = new KeyboardBinding();
Bindings.Clear(); kb.key = e.KeyCode;
Bindings.Add(kb); kb.modifiers = e.Modifiers;
UpdateLabel(); Bindings.Clear();
Bindings.Add(kb);
UpdateLabel();
}
else
{
Bindings.Clear();
UpdateLabel();
}
} }
protected override void OnKeyPress(KeyPressEventArgs e) protected override void OnKeyPress(KeyPressEventArgs e)