public static void RefreshMouseMode() { InputEventAction mouseMode = new InputEventAction(); mouseMode.Action = "RefreshMouseMode"; Instance._UnhandledInput(mouseMode); }
public static InputEvent CreateInputEventAction(string action, bool pressed) { InputEventAction newEvent = new InputEventAction(); newEvent.Action = action; newEvent.Pressed = pressed; return(newEvent); }
private void EmulateInput(string input, bool pressed) { InputEventAction inp = new InputEventAction(); inp.Action = input; inp.Pressed = pressed; Input.ParseInputEvent(inp); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { GetNode <Timer>("MessageTimer").Connect("timeout", this, nameof(OnMessageTimerTimeout)); GetNode <Button>("StartButton").Connect("pressed", this, nameof(OnStartButtonPressed)); ShortCut shortCut = new ShortCut(); InputEventAction eventAction = new InputEventAction(); eventAction.Action = "ui_select"; shortCut.Shortcut = eventAction; GetNode <Button>("StartButton").Shortcut = shortCut; }
public override void _Input(InputEvent @event) { InputEventAction eventAction = new InputEventAction(); //eventAction.Action = if (Input.IsActionPressed("Forward")) { GlobalTranslate(new Vector3(0, 0, MoveSpeed)); } if (Input.IsActionPressed("Back")) { GlobalTranslate(new Vector3(0, 0, MoveSpeed * -1)); } base._Input(@event); }