Document Controls

This commit is contained in:
TheBrokenRail 2022-10-02 01:23:46 -04:00
parent c178e5e5eb
commit 4870afcc7f
3 changed files with 47 additions and 1 deletions

44
docs/CONTROLS.md Normal file
View File

@ -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.

View File

@ -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)

View File

@ -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