diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-09-02 00:05:29 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-09-02 00:05:29 -0700 |
| commit | 51ecf9530dae94341e2ba96453a4bf7e376ad33b (patch) | |
| tree | 24b3ec0eee4729802cddbb6af4556999e3e42d9b /src/input.rs | |
| parent | 5ebc92d5a6bbbe14e7c4c25b25a4ff8578ddcd5a (diff) | |
character controller
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index 30f3834..e795a61 100644 --- a/src/input.rs +++ b/src/input.rs @@ -14,6 +14,11 @@ pub enum Input { Down, Right, + CameraUp, + CameraLeft, + CameraDown, + CameraRight, + // sim management Pause, Step, @@ -34,13 +39,17 @@ pub enum Input { Action6, } -const INPUT_VAR_LEN: usize = 17; +const INPUT_VAR_LEN: usize = 21; const KEYMAP: [(KeyCode, Input); INPUT_VAR_LEN] = [ (KeyCode::KeyW, Input::Up), (KeyCode::KeyA, Input::Left), (KeyCode::KeyS, Input::Down), (KeyCode::KeyD, Input::Right), + (KeyCode::ArrowUp, Input::CameraUp), + (KeyCode::ArrowLeft, Input::CameraLeft), + (KeyCode::ArrowDown, Input::CameraDown), + (KeyCode::ArrowRight, Input::CameraRight), (KeyCode::Space, Input::Pause), (KeyCode::KeyX, Input::Step), (KeyCode::KeyC, Input::ClearGrid), |
