public void AddInputPanel(InputActionDelegate action) { FrameworkElement panel = GameManager.instance.GetResource <FrameworkElement>("DialogInput"); AddContent(panel); inputBox = WaywardEngine.Utilities.FindNode <TextBox>(panel, "InputBox"); inputBox.KeyDown += (sender, e) => { if (e.Key != Key.Return) { return; } action(inputBox.Text); CloseAction(); }; }
public void AddAction(InputActionType inputActionType, InputActionDelegate inputAction) { _actions.Add(inputActionType, inputAction); }
public void RegisterKeyPressed(Key key, InputActionDelegate action) { GetInputAction(key).KeyPressed += action; ; }
public void RegisterKeyUp(Key key, InputActionDelegate action) { GetInputAction(key).KeyUp += action; }
public void RegisterKeyDown(Key key, InputActionDelegate action) { GetInputAction(key).KeyDown += action; ; }