Input widget - Check for duplicates in binding array before committing a mapping
This commit is contained in:
parent
7c9d170248
commit
0407bb2e86
|
@ -78,12 +78,26 @@ namespace BizHawk.MultiClient
|
||||||
if (TempBindingStr == "Alt+F4")
|
if (TempBindingStr == "Alt+F4")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!IsDuplicate(TempBindingStr))
|
||||||
|
{
|
||||||
Bindings[pos] = TempBindingStr;
|
Bindings[pos] = TempBindingStr;
|
||||||
wasPressed = TempBindingStr;
|
wasPressed = TempBindingStr;
|
||||||
UpdateLabel();
|
UpdateLabel();
|
||||||
Increment();
|
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)
|
protected override void OnKeyUp(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue