From 9553cfc29cc3bce33f546a18debb770e721e4af3 Mon Sep 17 00:00:00 2001 From: Nindaleth Date: Mon, 3 Oct 2022 23:46:54 +0200 Subject: [PATCH] allow using Enter in addition to LMB in journal and inventory (#332) Co-authored-by: Black_Fox --- game/ui/gamemenu.cpp | 4 ++++ game/ui/inventorymenu.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/game/ui/gamemenu.cpp b/game/ui/gamemenu.cpp index a920e9a93..200ec8836 100644 --- a/game/ui/gamemenu.cpp +++ b/game/ui/gamemenu.cpp @@ -123,6 +123,10 @@ struct GameMenu::ListViewDialog : Dialog { void keyDownEvent(KeyEvent &e) override { e.accept(); } void keyUpEvent (KeyEvent &e) override { + if(e.key==Event::K_Return) { + showQuest(); + return; + } if(e.key==Event::K_ESCAPE) { close(); return; diff --git a/game/ui/inventorymenu.cpp b/game/ui/inventorymenu.cpp index 31c4c930a..42bf88138 100644 --- a/game/ui/inventorymenu.cpp +++ b/game/ui/inventorymenu.cpp @@ -321,7 +321,7 @@ void InventoryMenu::keyDownEvent(KeyEvent &e) { takeTimer.start(200); onTakeStuff(); } - else if (keycodec.tr(e)==KeyCodec::ActionGeneric) { + else if (keycodec.tr(e)==KeyCodec::ActionGeneric || e.key==KeyEvent::K_Return) { onItemAction(Item::NSLOT); } else if((KeyEvent::K_3<=e.key && e.key<=KeyEvent::K_9) || e.key==KeyEvent::K_0) {