Godot:InputMap
godot - 사용자 입력.
Action
액션은 여러 입력을 하나의 액션 그룹으로 분류할 수 있다.
Events
- Key
- 키보드
- Joy Button
- 조이스틱 버튼
- Joy Axis
- 조이스틱 아날로그 컨트롤
- Mouse Button
- 터치패드 및 마우스 입력.
- 스마트폰 스크린 터치는
Device 0
,Left Button
으로 적용하면 된다.
Example
ui_accept
라는 액션으로 묶인 입력을 처리하는 방법은 Godot.Input.IsActionJustPressed 함수를 사용하면 된다.
using Godot;
using System;
public class Piano : Node2D
{
// ...
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(float delta)
{
if (Godot.Input.IsActionJustPressed("ui_accept"))
{
GD.Print("Left Mouse.");
}
}
// ...
}