diff --git a/docs/CONTROLS.md b/docs/CONTROLS.md new file mode 100644 index 00000000..c71b3c46 --- /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 e64f0035..5f3c0fd9 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 b144561c..2c9b2a9e 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