From 8ac14130b2be1b10b577c17e9e264b48fa127d70 Mon Sep 17 00:00:00 2001 From: ShenMian Date: Sun, 14 Jan 2024 17:20:31 +0800 Subject: [PATCH] chore: update keymap --- README.md | 6 +++--- src/systems/input.rs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f40da5..b2f4751 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A sokoban with a solver. | Click `Left` on player reachable area | Move the character to this position | | Click `Left` on a crate | Show the reachable area of the crate | | Click `Left` on crate reachable area | Push the selected crate to this position | -| Hold `Right` and drag | Drag the board | +| Hold `Right` and drag | Adjust viewport | | Click `Button 4` | Undo last push | | Click `Button 5` | Redo last push | | Scroll `Middle` | Zoom in/out | @@ -45,7 +45,6 @@ A sokoban with a solver. | Key | Action | |-----------------|-----------------------------------| | `H`/`J`/`K`/`L` | Move the character | -| `[`/`]` | Switch to the previous/next level | | `U` | Undo last push | | `Ctrl` + `R` | Redo last push | @@ -58,7 +57,8 @@ A sokoban with a solver. | `B`/`Circle` | Undo last push | | `A`/`Cross` | Redo last push | | `LT`/`RT` | Zoom in/out | -| Right stick | Move viewport | +| Right stick | Adjust viewport | +| `X`/`Square` | Trigger instant move[^1] | | `Y`/`Triangle` | Automatic solution | [^1]: Turn off character and crates movement animations. diff --git a/src/systems/input.rs b/src/systems/input.rs index f990514..476e241 100644 --- a/src/systems/input.rs +++ b/src/systems/input.rs @@ -190,6 +190,10 @@ impl Action { UserInput::Single(InputKind::GamepadButton(GamepadButtonType::RightTrigger2)), Self::ZoomIn, ), + ( + UserInput::Single(InputKind::GamepadButton(GamepadButtonType::West)), + Self::InstantMove, + ), ( UserInput::Single(InputKind::GamepadButton(GamepadButtonType::North)), Self::AutomaticSolution,