From 4870afcc7f941c34a2c96e21ecc389f3d09d5baa Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 2 Oct 2022 01:23:46 -0400 Subject: [PATCH] Document Controls --- docs/CONTROLS.md | 44 ++++++++++++++++++++++++++++++++++++ docs/README.md | 1 + media-layer/core/src/media.c | 3 ++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 docs/CONTROLS.md diff --git a/docs/CONTROLS.md b/docs/CONTROLS.md new file mode 100644 index 0000000..c71b3c4 --- /dev/null +++ b/docs/CONTROLS.md @@ -0,0 +1,44 @@ +# In-Game Controls + +### Keyboard & Mouse +| Action | Function | +| --- | --- | +| W | Move Forward | +| A | Move Left | +| S | Move Backward | +| D | Move Right | +| Space | Jump | +| Shift | Sneak | +| E | Open Inventory | +| Q | Drop Item | +| Ctrl+Q | Drop Item Stack | +| 1-9 | Select Item In Toolbar/Hotbar | +| Escape | Pause | +| Tab | Lock/Unlock Mouse | +| F11 | Fullscreen | +| F2 | Screenshot | +| F1 | Hide GUI | +| F5 | Change Perspective | +| T | Open Chat | +| Mouse Movement | Camera Control | +| Scroll Wheel | Cycle Selected Item In Toolbar | +| Left-CLick | Attack/Destroy | +| Right-Click | Use Item/Place Block | + +### Game Controller +| Action | Function | +| --- | --- | +| A | Jump | +| D-Pad Down | Drop Item | +| Y | Open Inventory | +| D-Pad Up | Change Perspective | +| B | Sneak[^1] | +| D-Pad Right | Open Chat | +| Left/Right Bumper | Cycle Selected Item In Toolbar | +| Left Trigger | Attack/Destroy | +| Right Trigger | Use Item/Place Block | +| Start/Back | Pause | +| Left Stick | Camera Control | +| Right Stick | Movement | + +[^1]: Unlike Minecraft: Bedrock Edition, this *is not* a toggle. diff --git a/docs/README.md b/docs/README.md index e64f003..5f3c0fd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,4 +9,5 @@ * [View Command Line Arguments](COMMAND_LINE.md) * [View Multiplayer](MULTIPLAYER.md) * [View Sound](SOUND.md) +* [View In-Game Controls](CONTROLS.md) * [View Changelog](CHANGELOG.md) diff --git a/media-layer/core/src/media.c b/media-layer/core/src/media.c index b144561..2c9b2a9 100644 --- a/media-layer/core/src/media.c +++ b/media-layer/core/src/media.c @@ -83,7 +83,7 @@ static SDLKey glfw_key_to_sdl_key(int key) { // Drop Item case GLFW_KEY_Q: return SDLK_q; - // Hotbar + // Toolbar case GLFW_KEY_1: return SDLK_1; case GLFW_KEY_2: @@ -301,6 +301,7 @@ static SDLKey glfw_controller_button_to_key(int button) { static void glfw_controller_button(int button, int action) { int key = glfw_controller_button_to_key(button); if (key != GLFW_KEY_UNKNOWN) { + // Press Key glfw_key_raw(key, glfwGetKeyScancode(key), action, 0); } else { // Scrolling