Input widget - Check for duplicates in binding array before committing a mapping
This commit is contained in:
parent
7c9d170248
commit
0407bb2e86
|
@ -78,13 +78,27 @@ namespace BizHawk.MultiClient
|
|||
if (TempBindingStr == "Alt+F4")
|
||||
return;
|
||||
|
||||
Bindings[pos] = TempBindingStr;
|
||||
wasPressed = TempBindingStr;
|
||||
UpdateLabel();
|
||||
Increment();
|
||||
if (!IsDuplicate(TempBindingStr))
|
||||
{
|
||||
Bindings[pos] = TempBindingStr;
|
||||
wasPressed = TempBindingStr;
|
||||
UpdateLabel();
|
||||
Increment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDuplicate(string binding)
|
||||
{
|
||||
for (int x = 0; x < MaxBind; x++)
|
||||
{
|
||||
if (Bindings[x] == binding)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnKeyUp(KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.F4 && e.Modifiers == Keys.Alt)
|
||||
|
|
Loading…
Reference in New Issue