diff --git a/src/definitions.cpp b/src/definitions.cpp index 68c40688..d0112e48 100644 --- a/src/definitions.cpp +++ b/src/definitions.cpp @@ -106,4 +106,5 @@ void setup_bindings() { Events::bind(BIND_CAM_ZOOM, inputtype::keyboard, keycode::C); Events::bind(BIND_PLAYER_NOCLIP, inputtype::keyboard, keycode::N); Events::bind(BIND_PLAYER_FLIGHT, inputtype::keyboard, keycode::F); + Events::bind(BIND_HUD_INVENTORY, inputtype::keyboard, keycode::TAB); } \ No newline at end of file diff --git a/src/definitions.h b/src/definitions.h index 3489d998..ce70975d 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -32,6 +32,7 @@ #define BIND_CAM_ZOOM "camera.zoom" #define BIND_PLAYER_NOCLIP "player.noclip" #define BIND_PLAYER_FLIGHT "player.flight" +#define BIND_HUD_INVENTORY "hud.inventory" extern void setup_bindings(); extern void setup_definitions(); diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index 1e72d7fb..51246ce1 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -309,7 +309,7 @@ void HudRenderer::draw(const GfxContext& ctx){ pauseMenu->visible(true); } } - if (Events::jpressed(keycode::TAB)) { + if (Events::jactive("hud.inventory")) { if (!pause) { inventoryOpen = !inventoryOpen; }