# core/inputmanager (vanilla-engine 0.4.0)

> https://vanillapunch.com/docs/vanilla-engine/0.4.0/api/core/inputmanager/

입력 관리자.
- 키 이름은 원본과 같이 KeyboardEvent.code 꼴이다. ("KeyA", "ArrowLeft", "Space" ...)
  winit 의 KeyCode 이름이 같은 W3C 규약을 따르므로 그대로 문자열로 바꿔 쓴다. 윈도우 키(커맨드 키)만 winit 이 SuperLeft, SuperRight 라 부르고
  W3C 의 옛 Super 키를 Meta 라 불러서, 데스크탑 플랫폼이 MetaLeft, MetaRight, Super 로 바꿔 넣는다.
- KeyCode 의 상수 이름은 원본 KeyCode 의 키 이름을 러스트 상수 꼴로 바꾼 것이다. ("0" 처럼 이름이 될 수 없는 것은 DIGIT0)
  원본에 없던 LEFT, UP, RIGHT, DOWN 은 ARROWLEFT 들과 같은 값으로 남긴다.
- 마우스 단추(또는 첫 손가락)를 터치로 다룬다. (원본은 마우스와 터치를 하나로 모은다) 원본처럼 처음에는 어느 단추든 터치이고,
  set_touch_from_left_button_only(true) 면 왼쪽 단추만 터치다. 캔버스의 오른쪽 클릭 메뉴를 막을지(set_context_menu_prevented, 처음은 참)는 웹에서 브라우저 문맥 메뉴를 막는다.
  데스크탑 창에는 브라우저 문맥 메뉴가 없어 크롬에서 막은 것과 같은 결과다.
- 그 밖에 마우스 단추 셋(왼쪽, 가운데, 오른쪽)의 눌림, 닿아 있는 손가락 목록, 마지막 입력이 손가락인지, 휠을 Ctrl 과 함께 굴렸는지를 둔다.
  카메라 손짓(CameraGestures)처럼 단추 하나 터치 밖의 입력을 쓰는 곳이 읽는다. 플랫폼이 채운다. (vanilla.js 는 캔버스 DOM 사건을 직접 읽던 것)
- 게임패드는 원본과 같이 InputManager 가 GamepadManager 를 들고 tick 에서 폴링한다. (core/gamepadmanager.rs)
- 글 입력(확정 글, IME 조합, 편집 키)은 TextInput 줄에 모은다. 입력 필드가 꺼내 쓴다. (core/textinput.rs, 원본에 없는 층)
- 키와 마우스 단추의 이번 프레임 누름과 뗌은 원본처럼 지난 프레임 끝 뒤로 온 사건을 쌓아 본다. 프레임 사이에 눌렀다 뗀 것도 잡힌다.
- 손가락은 원본처럼 닿음(begin_touch_point), 움직임, 뗌을 받아 단계(TouchPhase)를 매기고, 떨어진 손가락은 한 프레임 get_ended_touch_points 에 남는다.
- 마지막으로 쓴 장치(InputDevice)와 패드 종류, 막을 키(set_prevented_keys), 글자 입력칸에 쓰는 중인지(is_typing_in_text_field), 입력 동작(InputActions)을 둔다.
  막을 키는 웹에서 브라우저 기본 동작(Tab 의 포커스 옮기기, Space 와 화살표의 스크롤, F5 새로 고침 같은 것)을 막는다. 데스크탑 창에는 그런 기본 동작이 없어 막은 것과 같은 결과다.
  글자 입력칸은 엔진 입력 필드(TextInput 의 활성 필드)와, 웹에서는 문서의 초점(글자 input, textarea, contenteditable, select)을 본다.

예제: 플랫폼이 넣은 키, 마우스 단추, 손가락을 읽고 프레임 끝을 넘기기

```rust
use vanilla::{InputManager, KeyCode, MouseButton, TouchPhase, Vector2};

let mut input_manager = InputManager::new();
input_manager.push_key(KeyCode::SPACE);
input_manager.set_mouse_button_down(MouseButton::Left, true);
input_manager.begin_touch_point(1, Vector2::create(10.0, 20.0), Vector2::create(20.0, 40.0));
assert!(input_manager.is_key_just_pressed(KeyCode::SPACE));
assert!(input_manager.is_mouse_button_just_pressed(MouseButton::Left));
assert_eq!(input_manager.get_touch_points()[0].phase, TouchPhase::Began);

input_manager.update_frame_snapshot();
assert!(input_manager.is_key_pressed(KeyCode::SPACE));
assert!(!input_manager.is_key_just_pressed(KeyCode::SPACE));
assert!(input_manager.is_mouse_button_down(MouseButton::Left));
assert_eq!(input_manager.get_touch_points()[0].phase, TouchPhase::Stationary);
```

## KeyCode (struct)

키 이름. (원본 KeyCode)
- 값은 KeyboardEvent.code 문자열이다. 상수에 없는 키는 그 이름 문자열("ShiftRight", "ControlRight" 같은)을 그대로 쓴다.

예제: 상수 값과 키 읽기

```rust
use vanilla::{InputManager, KeyCode};

assert_eq!(KeyCode::A, "KeyA");
assert_eq!(KeyCode::LEFT, KeyCode::ARROWLEFT);
let mut input_manager = InputManager::new();
input_manager.push_key(KeyCode::ENTER);
assert!(input_manager.is_key_pressed("Enter"));
assert!(!input_manager.is_key_pressed(KeyCode::NUMPAD_ENTER));
```

- `pub const A: &'static str = "KeyA"` (static, since 0.3.2): A 키.
  - returns &'static str
- `pub const B: &'static str = "KeyB"` (static, since 0.3.2): B 키.
  - returns &'static str
- `pub const C: &'static str = "KeyC"` (static, since 0.3.2): C 키.
  - returns &'static str
- `pub const D: &'static str = "KeyD"` (static, since 0.3.2): D 키.
  - returns &'static str
- `pub const E: &'static str = "KeyE"` (static, since 0.3.2): E 키.
  - returns &'static str
- `pub const F: &'static str = "KeyF"` (static, since 0.3.2): F 키.
  - returns &'static str
- `pub const G: &'static str = "KeyG"` (static, since 0.3.2): G 키.
  - returns &'static str
- `pub const H: &'static str = "KeyH"` (static, since 0.3.2): H 키.
  - returns &'static str
- `pub const I: &'static str = "KeyI"` (static, since 0.3.2): I 키.
  - returns &'static str
- `pub const J: &'static str = "KeyJ"` (static, since 0.3.2): J 키.
  - returns &'static str
- `pub const K: &'static str = "KeyK"` (static, since 0.3.2): K 키.
  - returns &'static str
- `pub const L: &'static str = "KeyL"` (static, since 0.3.2): L 키.
  - returns &'static str
- `pub const M: &'static str = "KeyM"` (static, since 0.3.2): M 키.
  - returns &'static str
- `pub const N: &'static str = "KeyN"` (static, since 0.3.2): N 키.
  - returns &'static str
- `pub const O: &'static str = "KeyO"` (static, since 0.3.2): O 키.
  - returns &'static str
- `pub const P: &'static str = "KeyP"` (static, since 0.3.2): P 키.
  - returns &'static str
- `pub const Q: &'static str = "KeyQ"` (static, since 0.3.2): Q 키.
  - returns &'static str
- `pub const R: &'static str = "KeyR"` (static, since 0.3.2): R 키.
  - returns &'static str
- `pub const S: &'static str = "KeyS"` (static, since 0.3.2): S 키.
  - returns &'static str
- `pub const T: &'static str = "KeyT"` (static, since 0.3.2): T 키.
  - returns &'static str
- `pub const U: &'static str = "KeyU"` (static, since 0.3.2): U 키.
  - returns &'static str
- `pub const V: &'static str = "KeyV"` (static, since 0.3.2): V 키.
  - returns &'static str
- `pub const W: &'static str = "KeyW"` (static, since 0.3.2): W 키.
  - returns &'static str
- `pub const X: &'static str = "KeyX"` (static, since 0.3.2): X 키.
  - returns &'static str
- `pub const Y: &'static str = "KeyY"` (static, since 0.3.2): Y 키.
  - returns &'static str
- `pub const Z: &'static str = "KeyZ"` (static, since 0.3.2): Z 키.
  - returns &'static str
- `pub const DIGIT0: &'static str = "Digit0"` (static, since 0.3.2): 숫자 0 키. (글자판 위쪽 줄, 텐키는 NUMPAD0)
  - returns &'static str
- `pub const DIGIT1: &'static str = "Digit1"` (static, since 0.3.2): 숫자 1 키. (글자판 위쪽 줄, 텐키는 NUMPAD1)
  - returns &'static str
- `pub const DIGIT2: &'static str = "Digit2"` (static, since 0.3.2): 숫자 2 키. (글자판 위쪽 줄, 텐키는 NUMPAD2)
  - returns &'static str
- `pub const DIGIT3: &'static str = "Digit3"` (static, since 0.3.2): 숫자 3 키. (글자판 위쪽 줄, 텐키는 NUMPAD3)
  - returns &'static str
- `pub const DIGIT4: &'static str = "Digit4"` (static, since 0.3.2): 숫자 4 키. (글자판 위쪽 줄, 텐키는 NUMPAD4)
  - returns &'static str
- `pub const DIGIT5: &'static str = "Digit5"` (static, since 0.3.2): 숫자 5 키. (글자판 위쪽 줄, 텐키는 NUMPAD5)
  - returns &'static str
- `pub const DIGIT6: &'static str = "Digit6"` (static, since 0.3.2): 숫자 6 키. (글자판 위쪽 줄, 텐키는 NUMPAD6)
  - returns &'static str
- `pub const DIGIT7: &'static str = "Digit7"` (static, since 0.3.2): 숫자 7 키. (글자판 위쪽 줄, 텐키는 NUMPAD7)
  - returns &'static str
- `pub const DIGIT8: &'static str = "Digit8"` (static, since 0.3.2): 숫자 8 키. (글자판 위쪽 줄, 텐키는 NUMPAD8)
  - returns &'static str
- `pub const DIGIT9: &'static str = "Digit9"` (static, since 0.3.2): 숫자 9 키. (글자판 위쪽 줄, 텐키는 NUMPAD9)
  - returns &'static str
- `pub const BACKSPACE: &'static str = "Backspace"` (static, since 0.3.2): 백스페이스 키.
  - returns &'static str
- `pub const TAB: &'static str = "Tab"` (static, since 0.3.2): 탭 키.
  - returns &'static str
- `pub const ENTER: &'static str = "Enter"` (static, since 0.3.2): 엔터 키. (글자판 쪽, 텐키 엔터는 NUMPAD_ENTER)
  - returns &'static str
- `pub const SHIFT: &'static str = "ShiftLeft"` (static, since 0.3.2): 왼쪽 시프트 키. (오른쪽은 "ShiftRight")
  - returns &'static str
- `pub const CTRL: &'static str = "ControlLeft"` (static, since 0.3.2): 왼쪽 컨트롤 키. (오른쪽은 "ControlRight")
  - returns &'static str
- `pub const ALT: &'static str = "AltLeft"` (static, since 0.3.2): 왼쪽 알트 키. (오른쪽은 "AltRight")
  - returns &'static str
- `pub const CAPSLOCK: &'static str = "CapsLock"` (static, since 0.3.2): 캡스 록 키.
  - returns &'static str
- `pub const ESCAPE: &'static str = "Escape"` (static, since 0.3.2): 이스케이프 키.
  - returns &'static str
- `pub const SPACE: &'static str = "Space"` (static, since 0.3.2): 스페이스 바.
  - returns &'static str
- `pub const PAGEUP: &'static str = "PageUp"` (static, since 0.3.2): 페이지 업 키.
  - returns &'static str
- `pub const PAGEDOWN: &'static str = "PageDown"` (static, since 0.3.2): 페이지 다운 키.
  - returns &'static str
- `pub const END: &'static str = "End"` (static, since 0.3.2): 엔드 키.
  - returns &'static str
- `pub const HOME: &'static str = "Home"` (static, since 0.3.2): 홈 키.
  - returns &'static str
- `pub const LEFT: &'static str = "ArrowLeft"` (static, since 0.3.2): 왼쪽 화살표 키. (ARROWLEFT 와 같은 값)
  - returns &'static str
- `pub const UP: &'static str = "ArrowUp"` (static, since 0.3.2): 위쪽 화살표 키. (ARROWUP 과 같은 값)
  - returns &'static str
- `pub const RIGHT: &'static str = "ArrowRight"` (static, since 0.3.2): 오른쪽 화살표 키. (ARROWRIGHT 와 같은 값)
  - returns &'static str
- `pub const DOWN: &'static str = "ArrowDown"` (static, since 0.3.2): 아래쪽 화살표 키. (ARROWDOWN 과 같은 값)
  - returns &'static str
- `pub const INSERT: &'static str = "Insert"` (static, since 0.3.2): 인서트 키.
  - returns &'static str
- `pub const DELETE: &'static str = "Delete"` (static, since 0.3.2): 딜리트 키.
  - returns &'static str
- `pub const F1: &'static str = "F1"` (static, since 0.3.2): F1 키.
  - returns &'static str
- `pub const F2: &'static str = "F2"` (static, since 0.3.2): F2 키.
  - returns &'static str
- `pub const F3: &'static str = "F3"` (static, since 0.3.2): F3 키.
  - returns &'static str
- `pub const F4: &'static str = "F4"` (static, since 0.3.2): F4 키.
  - returns &'static str
- `pub const F5: &'static str = "F5"` (static, since 0.3.2): F5 키.
  - returns &'static str
- `pub const F6: &'static str = "F6"` (static, since 0.3.2): F6 키.
  - returns &'static str
- `pub const F7: &'static str = "F7"` (static, since 0.3.2): F7 키.
  - returns &'static str
- `pub const F8: &'static str = "F8"` (static, since 0.3.2): F8 키.
  - returns &'static str
- `pub const F9: &'static str = "F9"` (static, since 0.3.2): F9 키.
  - returns &'static str
- `pub const F10: &'static str = "F10"` (static, since 0.3.2): F10 키.
  - returns &'static str
- `pub const F11: &'static str = "F11"` (static, since 0.3.2): F11 키.
  - returns &'static str
- `pub const F12: &'static str = "F12"` (static, since 0.3.2): F12 키.
  - returns &'static str
- `pub const ARROWLEFT: &'static str = "ArrowLeft"` (static, since 0.4.0): 왼쪽 화살표 키.
  - returns &'static str
- `pub const ARROWUP: &'static str = "ArrowUp"` (static, since 0.4.0): 위쪽 화살표 키.
  - returns &'static str
- `pub const ARROWRIGHT: &'static str = "ArrowRight"` (static, since 0.4.0): 오른쪽 화살표 키.
  - returns &'static str
- `pub const ARROWDOWN: &'static str = "ArrowDown"` (static, since 0.4.0): 아래쪽 화살표 키.
  - returns &'static str
- `pub const SCROLLLOCK: &'static str = "ScrollLock"` (static, since 0.4.0): 스크롤 록 키.
  - returns &'static str
- `pub const SEMICOLON: &'static str = "Semicolon"` (static, since 0.4.0): 세미콜론 키. (`;`)
  - returns &'static str
- `pub const EQUAL: &'static str = "Equal"` (static, since 0.4.0): 등호 키. (`=`)
  - returns &'static str
- `pub const COMMA: &'static str = "Comma"` (static, since 0.4.0): 쉼표 키. (`,`)
  - returns &'static str
- `pub const MINUS: &'static str = "Minus"` (static, since 0.4.0): 빼기 키. (`-`)
  - returns &'static str
- `pub const PERIOD: &'static str = "Period"` (static, since 0.4.0): 마침표 키. (`.`)
  - returns &'static str
- `pub const SLASH: &'static str = "Slash"` (static, since 0.4.0): 빗금 키. (`/`)
  - returns &'static str
- `pub const BACKQUOTE: &'static str = "Backquote"` (static, since 0.4.0): 백쿼트 키. (숫자 1 왼쪽 키)
  - returns &'static str
- `pub const BRACKETLEFT: &'static str = "BracketLeft"` (static, since 0.4.0): 왼쪽 대괄호 키. (`[`)
  - returns &'static str
- `pub const BACKSLASH: &'static str = "Backslash"` (static, since 0.4.0): 역빗금 키. (`\`)
  - returns &'static str
- `pub const BRACKETRIGHT: &'static str = "BracketRight"` (static, since 0.4.0): 오른쪽 대괄호 키. (`]`)
  - returns &'static str
- `pub const QUOTE: &'static str = "Quote"` (static, since 0.4.0): 따옴표 키. (`'`)
  - returns &'static str
- `pub const META: &'static str = "MetaLeft"` (static, since 0.4.0): 왼쪽 메타 키. (윈도우 키, 맥의 커맨드 키)
  - returns &'static str
- `pub const COMMAND: &'static str = "MetaLeft"` (static, since 0.4.0): 맥의 왼쪽 커맨드 키. (META 와 같은 값)
  - returns &'static str
- `pub const PAUSE: &'static str = "Pause"` (static, since 0.4.0): 일시 정지 키.
  - returns &'static str
- `pub const AUDIOVOLUMEUP: &'static str = "AudioVolumeUp"` (static, since 0.4.0): 소리 키우기 키.
  - returns &'static str
- `pub const AUDIOVOLUMEDOWN: &'static str = "AudioVolumeDown"` (static, since 0.4.0): 소리 줄이기 키.
  - returns &'static str
- `pub const AUDIOMUTE: &'static str = "AudioVolumeMute"` (static, since 0.4.0): 음소거. (W3C code 표의 이름 AudioVolumeMute)
  - returns &'static str
- `pub const AUDIOPLAY: &'static str = "MediaPlayPause"` (static, since 0.4.0): 재생/멈춤. (W3C code 표의 이름 MediaPlayPause, 표에 MediaPlay 는 없다)
  - returns &'static str
- `pub const AUDIOSTOP: &'static str = "MediaStop"` (static, since 0.4.0): 미디어 정지 키.
  - returns &'static str
- `pub const AUDIOPREV: &'static str = "MediaTrackPrevious"` (static, since 0.4.0): 이전 곡 키.
  - returns &'static str
- `pub const AUDIONEXT: &'static str = "MediaTrackNext"` (static, since 0.4.0): 다음 곡 키.
  - returns &'static str
- `pub const NUM_LOCK: &'static str = "NumLock"` (static, since 0.4.0): 넘 록 키.
  - returns &'static str
- `pub const NUMPAD_DIVIDE: &'static str = "NumpadDivide"` (static, since 0.4.0): 텐키 나누기.
  - returns &'static str
- `pub const NUMPAD_MULTIPLY: &'static str = "NumpadMultiply"` (static, since 0.4.0): 텐키 곱하기.
  - returns &'static str
- `pub const NUMPAD_SUBTRACT: &'static str = "NumpadSubtract"` (static, since 0.4.0): 텐키 빼기.
  - returns &'static str
- `pub const NUMPAD_DECIMAL: &'static str = "NumpadDecimal"` (static, since 0.4.0): 텐키 점.
  - returns &'static str
- `pub const NUMPAD_ADD: &'static str = "NumpadAdd"` (static, since 0.4.0): 텐키 더하기.
  - returns &'static str
- `pub const NUMPAD_ENTER: &'static str = "NumpadEnter"` (static, since 0.4.0): 텐키 엔터.
  - returns &'static str
- `pub const NUMPAD0: &'static str = "Numpad0"` (static, since 0.4.0): 텐키 0.
  - returns &'static str
- `pub const NUMPAD1: &'static str = "Numpad1"` (static, since 0.4.0): 텐키 1.
  - returns &'static str
- `pub const NUMPAD2: &'static str = "Numpad2"` (static, since 0.4.0): 텐키 2.
  - returns &'static str
- `pub const NUMPAD3: &'static str = "Numpad3"` (static, since 0.4.0): 텐키 3.
  - returns &'static str
- `pub const NUMPAD4: &'static str = "Numpad4"` (static, since 0.4.0): 텐키 4.
  - returns &'static str
- `pub const NUMPAD5: &'static str = "Numpad5"` (static, since 0.4.0): 텐키 5.
  - returns &'static str
- `pub const NUMPAD6: &'static str = "Numpad6"` (static, since 0.4.0): 텐키 6.
  - returns &'static str
- `pub const NUMPAD7: &'static str = "Numpad7"` (static, since 0.4.0): 텐키 7.
  - returns &'static str
- `pub const NUMPAD8: &'static str = "Numpad8"` (static, since 0.4.0): 텐키 8.
  - returns &'static str
- `pub const NUMPAD9: &'static str = "Numpad9"` (static, since 0.4.0): 텐키 9.
  - returns &'static str

## TouchPoint (struct) (Clone, Copy, PartialEq, Debug)

닿아 있는 손가락 하나. (플랫폼의 손가락 번호, 단계, 캔버스 논리 좌표와 뷰 좌표)

예제: 손가락 둘을 닿게 하고 하나를 떼기

```rust
use vanilla::{InputManager, TouchPhase, Vector2};

let mut input_manager = InputManager::new();
input_manager.begin_touch_point(3, Vector2::create(10.0, 10.0), Vector2::create(20.0, 20.0));
input_manager.begin_touch_point(4, Vector2::create(50.0, 10.0), Vector2::create(100.0, 20.0));
input_manager.end_touch_point(3, Vector2::create(12.0, 10.0), Vector2::create(24.0, 20.0), false);
let touch_point = input_manager.get_touch_points()[0];
assert_eq!(touch_point.identifier, 4);
assert_eq!(touch_point.view_position, Vector2::create(100.0, 20.0));
let ended_touch_point = input_manager.get_ended_touch_points()[0];
assert_eq!(ended_touch_point.phase, TouchPhase::Ended);
assert_eq!(ended_touch_point.canvas_native_position, Vector2::create(12.0, 10.0));
```

- `pub identifier: i64` (field, since 0.4.0): 플랫폼의 손가락 번호. (닿아 있는 동안 같다)
  - returns i64
- `pub phase: TouchPhase` (field, since 0.4.0): 단계.
  - returns TouchPhase
- `pub canvas_native_position: Vector2` (field, since 0.4.0): 창(캔버스) 안쪽 논리 좌표의 자리. (캔버스 왼쪽 위가 0, 논리 픽셀)
  - returns Vector2
- `pub view_position: Vector2` (field, since 0.4.0): 뷰 좌표의 자리. (ViewManager.canvas_position_to_view_position 으로 바꾼 것)
  - returns Vector2

## InputManager (struct) (Default)

입력 관리자. (원본 InputManager)
- 엔진이 하나 들고 플랫폼이 키, 마우스, 손가락, 휠 사건을 넣는다. 씬은 engine.get_input_manager() 로 읽는다.
- 이번 프레임의 누름과 뗌, 터치 Pressed / Released / Cancelled, 휠 이동량은 엔진이 프레임 끝에 비운다.

예제: 씬에서 키, 마우스, 휠 읽기

```rust
use vanilla::{Engine, EngineConfiguration, KeyCode, MouseButton, Scene, SceneBase};

struct MainScene {
	scene_base: SceneBase,
}

impl Scene for MainScene {
	fn get_scene_base(&self) -> &SceneBase {
		&self.scene_base
	}

	fn get_scene_base_mut(&mut self) -> &mut SceneBase {
		&mut self.scene_base
	}

	fn load(&mut self, engine: &Engine) {
		let mut input_manager = engine.get_input_manager_mut();
		input_manager.set_prevented_keys(&[KeyCode::TAB, KeyCode::SPACE]);
		input_manager.set_touch_from_left_button_only(true);
	}

	fn tick(&mut self, time_delta: f64) {
		let engine = Engine::get_engine().unwrap();
		self.scene_base.tick(time_delta);
		let input_manager = engine.get_input_manager();
		if input_manager.is_key_just_pressed(KeyCode::SPACE) {
			println!("jump");
		}
		if input_manager.is_mouse_button_down(MouseButton::Right) {
			println!("{:?}", input_manager.get_view_input_position());
		}
		if input_manager.has_wheel_delta() {
			println!("{}", input_manager.get_wheel_delta_y());
		}
	}
}

let engine_configuration = EngineConfiguration::new();
let engine = Engine::new(engine_configuration);
let main_scene = MainScene {
	scene_base: SceneBase::new(),
};
engine.run(Box::new(main_scene)).unwrap();
```

- `pub fn new() -> InputManager` (constructor, since 0.3.2): 생성.
  - 오른쪽 클릭 메뉴는 막고, 어느 마우스 단추든 터치로 넘긴다. 손가락이 주된 입력인 기기면 마지막 장치가 Touch 로 시작한다.
  - returns InputManager: 아무 키도 눌리지 않은 입력 관리자.
- `pub fn tick(&mut self, time_delta: f64)` (method, since 0.3.2): 주기적 갱신. (게임패드 폴링, 패드를 썼으면 마지막 장치를 게임패드로, 입력 동작 갱신)
  - 엔진이 프레임 첫머리에 부른다. 처음 부를 때 게임패드 입력원(데스크탑 gilrs)을 연다.
  - `time_delta` f64: 지난 프레임 뒤로 흐른 초. (입력 동작의 반복 시간에 쓴다)
- `pub fn clear(&mut self)` (method, since 0.3.2): 모든 입력 상태 비우기. (창이 포커스를 잃었을 때)
- `pub fn add_wheel_delta(&mut self, delta_x: f64, delta_y: f64)` (method, since 0.3.2): 휠 이동량 누적.
  - 플랫폼이 휠 사건마다 부르고, 엔진이 프레임 끝에 clear_wheel_delta 로 비운다.
  - `delta_x` f64: 가로 이동량. (픽셀, 브라우저 WheelEvent.deltaX 와 같은 방향)
  - `delta_y` f64: 세로 이동량. (픽셀, 브라우저 WheelEvent.deltaY 와 같은 방향, 내용을 아래로 넘기면 양수)

  예제: 한 프레임에 두 번 굴린 휠을 모아 읽기

  ```rust
  use vanilla::InputManager;
  
  let mut input_manager = InputManager::new();
  input_manager.add_wheel_delta(0.0, 40.0);
  input_manager.add_wheel_delta(0.0, 40.0);
  assert!(input_manager.has_wheel_delta());
  assert_eq!(input_manager.get_wheel_delta_y(), 80.0);
  input_manager.clear_wheel_delta();
  assert!(!input_manager.has_wheel_delta());
  ```

- `pub fn get_wheel_delta_x(&self) -> f64` (method, since 0.3.2): 이번 프레임의 가로 휠 이동량.
  - returns f64: 이번 프레임에 쌓인 가로 이동량. (픽셀, 오른쪽으로 넘기면 양수)
- `pub fn get_wheel_delta_y(&self) -> f64` (method, since 0.3.2): 이번 프레임의 세로 휠 이동량.
  - returns f64: 이번 프레임에 쌓인 세로 이동량. (픽셀, 내용을 아래로 넘기면 양수)
- `pub fn has_wheel_delta(&self) -> bool` (method, since 0.3.2): 이번 프레임에 휠을 굴렸는지.
  - returns bool: 가로나 세로 이동량이 0 이 아니면 true.
- `pub fn clear_wheel_delta(&mut self)` (method, since 0.3.2): 휠 이동량 비우기. (엔진이 프레임 끝에 부른다)
- `pub fn push_key(&mut self, key: &str)` (method, since 0.3.2): 키 눌림 기록.
  - 이미 눌려 있으면(키 되풀이) 이번 프레임의 누름으로 세지 않는다.
  - `key` &str: 키 이름. (KeyboardEvent.code, KeyCode 의 값)
- `pub fn pop_key(&mut self, key: &str)` (method, since 0.3.2): 키 뗌 기록.
  - 눌려 있지 않던 키면 아무것도 하지 않는다.
  - `key` &str: 키 이름. (KeyboardEvent.code, KeyCode 의 값)
- `pub fn is_key_pressed(&self, key: &str) -> bool` (method, since 0.3.2): 키가 눌려 있는지.
  - `key` &str: 키 이름. (KeyboardEvent.code, KeyCode 의 값)
  - returns bool: 눌린 채면 true.
- `pub fn is_key_just_pressed(&self, key: &str) -> bool` (method, since 0.3.2): 이번 프레임에 눌렸는지. (지난 프레임 끝 뒤로 온 사건, 프레임 사이에 눌렀다 뗀 키도 참이고 그때는 is_key_pressed 가 거짓)
  - `key` &str: 키 이름. (KeyboardEvent.code, KeyCode 의 값)
  - returns bool: 지난 프레임 끝 뒤로 새로 눌렸으면 true. (키 되풀이는 세지 않는다)

  예제: 프레임 사이에 눌렀다 뗀 키

  ```rust
  use vanilla::{InputManager, KeyCode};
  
  let mut input_manager = InputManager::new();
  input_manager.push_key(KeyCode::Z);
  input_manager.pop_key(KeyCode::Z);
  assert!(input_manager.is_key_just_pressed(KeyCode::Z));
  assert!(input_manager.is_key_just_released(KeyCode::Z));
  assert!(!input_manager.is_key_pressed(KeyCode::Z));
  input_manager.update_frame_snapshot();
  assert!(!input_manager.is_key_just_pressed(KeyCode::Z));
  ```

- `pub fn is_key_just_released(&self, key: &str) -> bool` (method, since 0.3.2): 이번 프레임에 떼졌는지.
  - `key` &str: 키 이름. (KeyboardEvent.code, KeyCode 의 값)
  - returns bool: 지난 프레임 끝 뒤로 떼어졌으면 true.
- `pub fn update_frame_snapshot(&mut self)` (method, since 0.3.2): 프레임 끝 스냅샷. (쌓인 키와 마우스 단추의 누름과 뗌을 비우고, 떨어진 손가락을 지우고 남은 손가락을 가만히로)
- `pub fn set_mouse_button_down(&mut self, mouse_button: MouseButton, is_down: bool)` (method, since 0.4.0): 마우스 단추 눌림 설정. (플랫폼이 부른다)
  - 바뀐 때만 이번 프레임의 누름이나 뗌으로 쌓는다.
  - `mouse_button` MouseButton: 단추.
  - `is_down` bool: 눌렸으면 true, 뗐으면 false.
- `pub fn is_mouse_button_down(&self, mouse_button: MouseButton) -> bool` (method, since 0.4.0): 마우스 단추가 눌려 있는지.
  - `mouse_button` MouseButton: 단추.
  - returns bool: 눌린 채면 true.
- `pub fn is_mouse_button_just_pressed(&self, mouse_button: MouseButton) -> bool` (method, since 0.4.0): 이번 프레임에 마우스 단추를 눌렀는지.
  - `mouse_button` MouseButton: 단추.
  - returns bool: 지난 프레임 끝 뒤로 눌렀으면 true. (프레임 사이에 눌렀다 뗀 것도)
- `pub fn is_mouse_button_just_released(&self, mouse_button: MouseButton) -> bool` (method, since 0.4.0): 이번 프레임에 마우스 단추를 뗐는지.
  - `mouse_button` MouseButton: 단추.
  - returns bool: 지난 프레임 끝 뒤로 뗐으면 true.
- `pub fn set_touch_from_left_button_only(&mut self, is_left_button_only: bool)` (method, since 0.4.0): 마우스 왼쪽 단추만 터치로 넘길지 설정. (끄면(기본) 어느 단추든 터치다)
  - 오른쪽이나 가운데 끌기를 카메라에 쓰는 게임이 켜면 그 단추로 UI 가 눌리지 않는다.
  - `is_left_button_only` bool: 왼쪽 단추만 터치로 넘기려면 true.

  예제: 오른쪽 단추를 터치에서 빼기

  ```rust
  use vanilla::{InputManager, MouseButton};
  
  let mut input_manager = InputManager::new();
  assert!(input_manager.is_touch_button(MouseButton::Right));
  input_manager.set_touch_from_left_button_only(true);
  assert!(input_manager.is_touch_button(MouseButton::Left));
  assert!(!input_manager.is_touch_button(MouseButton::Right));
  ```

- `pub fn is_touch_from_left_button_only(&self) -> bool` (method, since 0.4.0): 마우스 왼쪽 단추만 터치로 넘기는지 반환.
  - returns bool: 왼쪽 단추만이면 true. (처음은 false)
- `pub fn is_touch_button(&self, mouse_button: MouseButton) -> bool` (method, since 0.4.0): 그 마우스 단추를 터치로 넘기는지. (플랫폼이 마우스 누름과 뗌에서 부른다)
  - `mouse_button` MouseButton: 단추.
  - returns bool: 터치로 넘기면 true. (왼쪽 단추만으로 정했으면 Left 만 true)
- `pub fn set_context_menu_prevented(&mut self, is_prevented: bool)` (method, since 0.4.0): 캔버스의 오른쪽 클릭 메뉴를 막을지 설정. (처음은 참, 데스크탑 창에는 막을 메뉴가 없다)
  - `is_prevented` bool: 막으려면 true.
- `pub fn is_context_menu_prevented(&self) -> bool` (method, since 0.4.0): 캔버스의 오른쪽 클릭 메뉴를 막는지 반환.
  - returns bool: 막으면 true. (처음은 true)
- `pub fn find_touch_point(&self, identifier: i64) -> Option<&TouchPoint>` (method, since 0.4.0): 닿아 있는 손가락 찾기. (없으면 None)
  - `identifier` i64: 플랫폼의 손가락 번호.
  - returns Option<&TouchPoint>: 그 번호의 닿아 있는 손가락. 없거나 이미 떨어졌으면 None.

  예제: 번호로 손가락 자리 읽기

  ```rust
  use vanilla::{InputManager, Vector2};
  
  let mut input_manager = InputManager::new();
  input_manager.begin_touch_point(7, Vector2::create(1.0, 2.0), Vector2::create(3.0, 4.0));
  let view_position = input_manager.find_touch_point(7).map(|touch_point| touch_point.view_position);
  assert_eq!(view_position, Some(Vector2::create(3.0, 4.0)));
  assert!(input_manager.find_touch_point(8).is_none());
  ```

- `pub fn begin_touch_point(&mut self, identifier: i64, canvas_native_position: Vector2, view_position: Vector2)` (method, since 0.4.0): 손가락이 닿음. (플랫폼이 부른다, 이미 있는 번호면 움직임으로 본다)
  - `identifier` i64: 플랫폼의 손가락 번호.
  - `canvas_native_position` Vector2: 창(캔버스) 안쪽 논리 좌표의 자리.
  - `view_position` Vector2: 뷰 좌표의 자리.
- `pub fn move_touch_point(&mut self, identifier: i64, canvas_native_position: Vector2, view_position: Vector2)` (method, since 0.4.0): 손가락이 움직임. (이번 프레임에 닿은 손가락은 Began 그대로)
  - 닿아 있지 않은 번호면 아무것도 하지 않는다.
  - `identifier` i64: 플랫폼의 손가락 번호.
  - `canvas_native_position` Vector2: 창(캔버스) 안쪽 논리 좌표의 새 자리.
  - `view_position` Vector2: 뷰 좌표의 새 자리.
- `pub fn end_touch_point(&mut self, identifier: i64, canvas_native_position: Vector2, view_position: Vector2, is_cancelled: bool)` (method, since 0.4.0): 손가락이 떨어짐. (닿은 목록에서 빼서 이번 프레임의 떨어진 목록에 둔다)
  - 닿아 있지 않은 번호면 아무것도 하지 않는다.
  - `identifier` i64: 플랫폼의 손가락 번호.
  - `canvas_native_position` Vector2: 뗀 자리. (창 안쪽 논리 좌표)
  - `view_position` Vector2: 뗀 자리. (뷰 좌표)
  - `is_cancelled` bool: 취소면 true(단계 Cancelled), 뗌이면 false(단계 Ended).
- `pub fn get_ended_touch_points(&self) -> &[TouchPoint]` (method, since 0.4.0): 이번 프레임에 떨어진 손가락 목록. (단계는 Ended, Cancelled, 자리는 뗀 자리)
  - returns &[TouchPoint]: 지난 프레임 끝 뒤로 떨어진 손가락들. (뗀 차례)
- `pub fn set_touch_points(&mut self, touch_points: Vec<TouchPoint>)` (method, since 0.4.0): 닿아 있는 손가락 목록 설정. (통째로 바꾼다, 단계는 넘긴 그대로)
  - `touch_points` Vec<TouchPoint>: 새 손가락 목록.
- `pub fn get_touch_points(&self) -> &[TouchPoint]` (method, since 0.4.0): 닿아 있는 손가락 목록. (닿은 차례, 단계는 Began, Moved, Stationary)
  - returns &[TouchPoint]: 닿아 있는 손가락들. 없으면 빈 조각.
- `pub fn set_touch_input(&mut self, is_touch_input: bool)` (method, since 0.4.0): 마지막 입력이 손가락인지 설정. (플랫폼이 부른다)
  - `is_touch_input` bool: 손가락이면 true, 마우스면 false.
- `pub fn is_touch_input(&self) -> bool` (method, since 0.4.0): 마지막 입력이 손가락인지. (마우스면 false, 처음에는 기기가 손가락이 주된 입력인지로. 원본 CameraGestures.isTouchInput 과 같다)
  - returns bool: 마지막 입력이 손가락이면 true.
- `pub fn set_wheel_with_ctrl(&mut self, is_wheel_with_ctrl: bool)` (method, since 0.4.0): 마지막 휠을 Ctrl 과 함께 굴렸는지 설정. (노트북 터치패드의 오므리기도 Ctrl 휠로 온다)
  - `is_wheel_with_ctrl` bool: Ctrl 과 함께였으면 true.
- `pub fn is_wheel_with_ctrl(&self) -> bool` (method, since 0.4.0): 마지막 휠을 Ctrl 과 함께 굴렸는지.
  - returns bool: 마지막 휠 사건이 Ctrl 과 함께였으면 true. (프레임 끝에 지우지 않는다)
- `pub fn set_touch_pressed(&mut self, value: bool)` (method, since 0.3.2): 터치 상태. (Pressed / Released / Cancelled 는 그 프레임에만 켜진다, Moved 는 누른 동안 켜진다 set_touch_moved)
  - `value` bool: 이번 프레임에 눌렀으면 true.
- `pub fn set_touch_released(&mut self, value: bool)` (method, since 0.3.2): 이번 프레임에 뗐는지 설정. (플랫폼이 켜고 엔진이 프레임 끝에 끈다)
  - `value` bool: 이번 프레임에 뗐으면 true.
- `pub fn set_touch_cancelled(&mut self, value: bool)` (method, since 0.3.2): 이번 프레임에 터치가 취소됐는지 설정. (플랫폼이 켜고 엔진이 프레임 끝에 끈다)
  - `value` bool: 이번 프레임에 취소됐으면 true.
- `pub fn set_touch_moved(&mut self, value: bool)` (method, since 0.3.2): 누르고 있는지. (원본처럼 누를 때 켜고 뗄 때 끈다, 프레임마다 지우지 않는다, 원본 주석 "입력시 뗄 때까지 계속 눌림")
  - `value` bool: 누를 때 true, 떼거나 취소될 때 false.
- `pub fn is_touch_pressed(&self) -> bool` (method, since 0.3.2): 이번 프레임에 터치를 눌렀는지.
  - returns bool: 이번 프레임에 눌렀으면 true. (첫 손가락이나 터치로 넘기는 마우스 단추)

  예제: 누름, 누르고 있음, 뗌 읽기

  ```rust
  use vanilla::InputManager;
  
  let mut input_manager = InputManager::new();
  input_manager.set_touch_pressed(true);
  input_manager.set_touch_moved(true);
  input_manager.set_touch_down(true);
  assert!(input_manager.is_touch_pressed());
  input_manager.set_touch_pressed(false);
  assert!(input_manager.is_touch_moved());
  assert!(input_manager.is_touch_down());
  input_manager.set_touch_moved(false);
  input_manager.set_touch_released(true);
  input_manager.set_touch_down(false);
  assert!(input_manager.is_touch_released());
  assert!(!input_manager.is_touch_down());
  ```

- `pub fn is_touch_released(&self) -> bool` (method, since 0.3.2): 이번 프레임에 터치를 뗐는지.
  - returns bool: 이번 프레임에 뗐으면 true.
- `pub fn is_touch_cancelled(&self) -> bool` (method, since 0.3.2): 이번 프레임에 터치가 취소됐는지.
  - returns bool: 이번 프레임에 취소됐으면 true. (플랫폼이 손가락 입력을 거둔 때)
- `pub fn is_touch_moved(&self) -> bool` (method, since 0.3.2): 누르고 있는지. (원본 isTouchMoved, 이름과 달리 움직이지 않아도 누른 동안 참)
  - returns bool: 누른 프레임부터 떼거나 취소될 때까지 true.
- `pub fn set_touch_down(&mut self, value: bool)` (method, since 0.3.2): 터치가 눌린 채인지. (러스트 판에서 더한 것. 눌린 동안 계속 켜져 있다)
  - `value` bool: 누를 때 true, 떼거나 취소될 때 false.
- `pub fn is_touch_down(&self) -> bool` (method, since 0.3.2): 터치가 눌린 채인지.
  - returns bool: 누른 프레임부터 떼거나 취소될 때까지 true. (누른 채 움직이지 않아도)
- `pub fn set_canvas_native_input_position(&mut self, position: Vector2)` (method, since 0.3.2): 입력 위치. (창 안쪽 논리 좌표 / 뷰 좌표)
  - 창 안쪽 논리 좌표의 입력 위치 설정. (플랫폼이 마우스와 첫 손가락에서 부른다)
  - `position` Vector2: 캔버스 왼쪽 위가 0 인 논리 픽셀 자리.
- `pub fn get_canvas_native_input_position(&self) -> Vector2` (method, since 0.3.2): 창 안쪽 논리 좌표의 입력 위치.
  - returns Vector2: 마지막 마우스나 첫 손가락의 자리. (캔버스 왼쪽 위가 0, 논리 픽셀, 처음은 0, 0)
- `pub fn set_view_input_position(&mut self, position: Vector2)` (method, since 0.3.2): 뷰 좌표의 입력 위치 설정. (플랫폼이 마우스와 첫 손가락에서 부른다)
  - `position` Vector2: 뷰 좌표의 자리.
- `pub fn get_view_input_position(&self) -> Vector2` (method, since 0.3.2): 뷰 좌표의 입력 위치. (씬의 touch_press 들이 받는 자리)
  - returns Vector2: 마지막 마우스나 첫 손가락의 뷰 좌표 자리. (처음은 0, 0)
- `pub fn update_all_gamepads(&mut self)` (method, since 0.3.2): 모든 게임패드 갱신.
- `pub fn connect_gamepad(&mut self, gamepad: &Gamepad)` (method, since 0.3.2): 게임패드 연결.
  - `gamepad` &Gamepad: 붙일 패드. (같은 index 가 이미 붙어 있으면 건너뛴다)
- `pub fn disconnect_gamepad(&mut self, gamepad: &Gamepad)` (method, since 0.3.2): 게임패드 연결 해제.
  - `gamepad` &Gamepad: 뗄 패드. (index 로 찾는다, 붙어 있지 않으면 건너뛴다)
- `pub fn get_gamepad_manager(&self) -> &GamepadManager` (method, since 0.3.2): 게임패드 매니저 반환.
  - returns &GamepadManager: 들고 있는 게임패드 관리자.
- `pub fn get_gamepad_manager_mut(&mut self) -> &mut GamepadManager` (method, since 0.3.2): 게임패드 매니저 반환. (바꿀 때: set_callback, connect 들)
  - returns &mut GamepadManager: 들고 있는 게임패드 관리자. (바꿀 수 있게)
- `pub fn get_text_input(&self) -> &TextInput` (method, since 0.3.2): 글 입력 줄 반환. (입력 필드가 꺼내 쓰고 상태를 올린다. &self 로 된다)
  - returns &TextInput: 들고 있는 글 입력 줄.
- `pub fn get_text_input_mut(&mut self) -> &mut TextInput` (method, since 0.3.2): 글 입력 줄 반환. (플랫폼이 이벤트를 넣을 때)
  - returns &mut TextInput: 들고 있는 글 입력 줄. (바꿀 수 있게)
- `pub fn set_last_input_device(&mut self, input_device: InputDevice)` (method, since 0.4.0): 마지막으로 쓴 입력 장치 설정. (플랫폼이 키, 마우스, 손가락 입력에서 부른다, 게임이 바깥 입력원을 쓸 때도)
  - `input_device` InputDevice: 장치.
- `pub fn get_last_input_device(&self) -> InputDevice` (method, since 0.4.0): 마지막으로 쓴 입력 장치. (처음은 손가락 기기면 Touch, 아니면 Keyboard)
  - returns InputDevice: 마지막으로 쓴 장치. (단추 안내를 키보드나 패드 표기로 가를 때)

  예제: 마지막 장치에 따라 안내 고르기

  ```rust
  use vanilla::{GamepadKind, InputDevice, InputManager};
  
  let mut input_manager = InputManager::new();
  input_manager.set_last_input_device(InputDevice::Gamepad);
  input_manager.set_last_gamepad_kind(GamepadKind::PlayStation);
  let hint = match input_manager.get_last_input_device() {
  	InputDevice::Gamepad => {
  		match input_manager.get_last_gamepad_kind() {
  			GamepadKind::PlayStation => {
  				"Cross"
  			}
  			_ => {
  				"A"
  			}
  		}
  	}
  	_ => {
  		"Enter"
  	}
  };
  assert_eq!(hint, "Cross");
  ```

- `pub fn set_last_gamepad_kind(&mut self, gamepad_kind: GamepadKind)` (method, since 0.4.0): 마지막으로 쓴 게임패드의 종류 설정.
  - `gamepad_kind` GamepadKind: 패드 종류.
- `pub fn get_last_gamepad_kind(&self) -> GamepadKind` (method, since 0.4.0): 마지막으로 쓴 게임패드의 종류. (단추를 누르거나 스틱을 크게 기울인 패드의 이름으로 가른다, 처음은 Other)
  - returns GamepadKind: 마지막으로 쓴 패드의 종류.
- `pub fn set_prevented_keys(&mut self, keys: &[&str])` (method, since 0.4.0): 브라우저 기본 동작을 막을 키 설정. (KeyboardEvent.code 목록, 웹에서만 뜻이 있다, 글자 입력칸에 쓰는 중이면 막지 않는다)
  - 앞서 정한 목록을 통째로 바꾼다.
  - `keys` &[&str]: 막을 키 이름 목록. (KeyCode 의 값)

  예제: 탭과 스페이스의 기본 동작 막기

  ```rust
  use vanilla::{InputManager, KeyCode};
  
  let mut input_manager = InputManager::new();
  input_manager.set_prevented_keys(&[KeyCode::TAB, KeyCode::SPACE]);
  assert!(input_manager.is_key_prevented("Tab"));
  assert!(!input_manager.is_key_prevented(KeyCode::F5));
  assert_eq!(input_manager.get_prevented_keys().len(), 2);
  ```

- `pub fn get_prevented_keys(&self) -> Vec<String>` (method, since 0.4.0): 브라우저 기본 동작을 막을 키 목록.
  - returns Vec<String>: 막을 키 이름의 사본. (차례는 정해지지 않는다)
- `pub fn is_key_prevented(&self, key: &str) -> bool` (method, since 0.4.0): 그 키의 기본 동작을 막는지.
  - `key` &str: 키 이름. (KeyboardEvent.code)
  - returns bool: 막을 키 목록에 있으면 true.
- `pub fn is_typing_in_text_field(&self) -> bool` (method, since 0.4.0): 글자 입력칸에 쓰는 중인지. (엔진 입력 필드의 포커스, 웹은 문서의 초점이 글자 input, textarea, contenteditable, select 에 있음)
  - returns bool: 엔진 입력 필드가 활성이거나 웹 문서의 초점이 글자 입력칸에 있으면 true.
- `pub fn get_input_actions(&self) -> &InputActions` (method, since 0.4.0): 입력 동작. (동작 이름에 키, 패드 단추, 축을 묶어 읽는다, tick 마다 갱신된다)
  - returns &InputActions: 들고 있는 입력 동작.
- `pub fn get_input_actions_mut(&mut self) -> &mut InputActions` (method, since 0.4.0): 입력 동작. (묶기, 반복, 바깥 입력원)
  - returns &mut InputActions: 들고 있는 입력 동작. (바꿀 수 있게)

## MouseButton (enum) (Clone, Copy, PartialEq, Eq, Hash, Debug)

마우스 단추.

- `Left`: 왼쪽 단추. (칸 번호 0)
- `Middle`: 가운데 단추. (휠 누름, 칸 번호 1)
- `Right`: 오른쪽 단추. (칸 번호 2)

- `pub fn get_index(&self) -> usize` (method, since 0.4.0): 단추 칸 번호.
  - returns usize: Left 0, Middle 1, Right 2.

## TouchPhase (enum) (Clone, Copy, PartialEq, Eq, Hash, Debug)

손가락의 단계. (Began 이번 프레임에 닿음, Moved 움직임, Stationary 가만히, Ended 뗌, Cancelled 취소)

- `Began`: 이번 프레임에 닿음. (닿은 프레임에는 움직여도 Began 그대로)
- `Moved`: 지난 프레임 뒤로 움직임.
- `Stationary`: 닿은 채 가만히. (프레임 끝 update_frame_snapshot 이 남은 손가락을 이것으로 바꾼다)
- `Ended`: 떨어짐. (get_ended_touch_points 에 한 프레임 남는다)
- `Cancelled`: 취소됨. (플랫폼이 손가락 입력을 거둔 것, get_ended_touch_points 에 한 프레임 남는다)

## InputDevice (enum) (Clone, Copy, PartialEq, Eq, Hash, Debug)

마지막으로 쓴 입력 장치.

- `Keyboard`: 키보드.
- `Mouse`: 마우스.
- `Touch`: 손가락. (터치 화면)
- `Gamepad`: 게임패드. (바깥 입력원 InputActionSource 가 넣은 패드 입력도)
