Pass KeyInput to OnKey functions
This commit is contained in:
committed by
Paul Chote
parent
2742985520
commit
6967c1fff3
@@ -171,8 +171,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
}
|
||||
};
|
||||
|
||||
nameTextfield.OnEnterKey = () => { nameTextfield.YieldKeyboardFocus(); return true; };
|
||||
nameTextfield.OnEscKey = () =>
|
||||
nameTextfield.OnEnterKey = _ => { nameTextfield.YieldKeyboardFocus(); return true; };
|
||||
nameTextfield.OnEscKey = _ =>
|
||||
{
|
||||
nameTextfield.Text = Settings.SanitizedPlayerName(ps.Name);
|
||||
escPressed = true;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
hotkeyEntryWidget = panel.Get<HotkeyEntryWidget>("HOTKEY_ENTRY");
|
||||
hotkeyEntryWidget.IsValid = () => isHotkeyValid;
|
||||
hotkeyEntryWidget.OnLoseFocus = ValidateHotkey;
|
||||
hotkeyEntryWidget.OnEscKey = () =>
|
||||
hotkeyEntryWidget.OnEscKey = _ =>
|
||||
{
|
||||
hotkeyEntryWidget.Key = modData.Hotkeys[selectedHotkeyDefinition.Name].GetValue();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user