now recognizes the keyboard better
This commit is contained in:
@@ -12,9 +12,9 @@ public partial class main : Node2D
|
|||||||
}
|
}
|
||||||
public override void _Process(double delta)
|
public override void _Process(double delta)
|
||||||
{
|
{
|
||||||
//CHANGE INPUT FOR NINTENDO CONTROLLER
|
|
||||||
//Checks if using Keyboard or controller and giving out current 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";
|
currentController = "PC";
|
||||||
}
|
}
|
||||||
@@ -23,6 +23,7 @@ public partial class main : Node2D
|
|||||||
currentController = Input.GetJoyName(0);
|
currentController = Input.GetJoyName(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CHANGE INPUT FOR NINTENDO CONTROLLER
|
||||||
if (currentController.StartsWith("Nintendo"))
|
if (currentController.StartsWith("Nintendo"))
|
||||||
{
|
{
|
||||||
InputMap.ActionAddEvent("ui_accept", new InputEventJoypadButton() { ButtonIndex = JoyButton.B});
|
InputMap.ActionAddEvent("ui_accept", new InputEventJoypadButton() { ButtonIndex = JoyButton.B});
|
||||||
@@ -46,7 +47,7 @@ public partial class main : Node2D
|
|||||||
GD.Print(currentController + " cancel");
|
GD.Print(currentController + " cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
//FULLSCREEN
|
//FULLSCREEN HOTKEY
|
||||||
if (Input.IsActionJustPressed("hotkey_fullscreen"))
|
if (Input.IsActionJustPressed("hotkey_fullscreen"))
|
||||||
{
|
{
|
||||||
if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen)
|
if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen)
|
||||||
|
Reference in New Issue
Block a user