diff --git a/project.godot b/project.godot index 18589de..7f458fb 100644 --- a/project.godot +++ b/project.godot @@ -32,6 +32,20 @@ import/fbx/enabled=false [input] +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"unicode":4194309,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"unicode":4194310,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +] +} +ui_cancel={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"unicode":4194305,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) +] +} move_left={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null) diff --git a/src/main.cs b/src/main.cs index 1f18e39..48c3655 100644 --- a/src/main.cs +++ b/src/main.cs @@ -3,14 +3,23 @@ using System; public partial class main : Node2D { + [Export] + public string currentController = Input.GetJoyName(0); // Called when the node enters the scene tree for the first time. public override void _Ready() { - } + } // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { + //gamepad + currentController = Input.GetJoyName(0); + if (currentController.StartsWith("Nintendo")) + { + + } + //fullscreen if (Input.IsActionJustPressed("hotkey_fullscreen")) { if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen) @@ -23,4 +32,5 @@ public partial class main : Node2D } } } + }