added project with nerabochie cows
This commit is contained in:
25
test.gd
Normal file
25
test.gd
Normal file
@ -0,0 +1,25 @@
|
||||
extends Node
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventKey:
|
||||
print("keyboard")
|
||||
if event is InputEventMouseButton:
|
||||
print("Mouse")
|
||||
elif event is InputEventJoypadButton \
|
||||
or (event is InputEventJoypadMotion and abs(event.axis_value) > 0.5):
|
||||
print(Input.get_joy_name(event.device))
|
||||
|
||||
func get_simplified_device_name(raw_name: String) -> String:
|
||||
match raw_name:
|
||||
"XInput Gamepad", "Xbox Series Controller", "Xbox 360 Controller", \
|
||||
"Xbox One Controller":
|
||||
return "X BOX"
|
||||
|
||||
"Sony DualSense", "PS5 Controller", "PS4 Controller", \
|
||||
"Nacon Revolution Unlimited Pro Controller":
|
||||
return "PS"
|
||||
|
||||
"Switch":
|
||||
return "Switch"
|
||||
_:
|
||||
return "DEVICE_GENERIC"
|
Reference in New Issue
Block a user