From 777cb3a1b29544899fcbfe315bf45a3b62e99708 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Sun, 27 Nov 2022 17:44:07 +0100 Subject: [PATCH] now recognizes the keyboard better --- src/main.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cs b/src/main.cs index a1b497e..3484858 100644 --- a/src/main.cs +++ b/src/main.cs @@ -12,9 +12,9 @@ public partial class main : Node2D } public override void _Process(double delta) { - //CHANGE INPUT FOR NINTENDO CONTROLLER //Checks if using Keyboard or controller and giving out current controller - if(Input.IsMouseButtonPressed(MouseButton.Left) || currentController == null)//this is a terrible way of doing this will be reworked + //this is a terrible way of doing this and will be reworked + if (Input.IsMouseButtonPressed(MouseButton.Left) || currentController == "" || currentController == null) { currentController = "PC"; } @@ -23,6 +23,7 @@ public partial class main : Node2D currentController = Input.GetJoyName(0); } + //CHANGE INPUT FOR NINTENDO CONTROLLER if (currentController.StartsWith("Nintendo")) { InputMap.ActionAddEvent("ui_accept", new InputEventJoypadButton() { ButtonIndex = JoyButton.B}); @@ -46,7 +47,7 @@ public partial class main : Node2D GD.Print(currentController + " cancel"); } - //FULLSCREEN + //FULLSCREEN HOTKEY if (Input.IsActionJustPressed("hotkey_fullscreen")) { if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen)