Skip to content

Commit

Permalink
allow using Enter in addition to LMB in journal and inventory (#332)
Browse files Browse the repository at this point in the history
Co-authored-by: Black_Fox <radekliska@gmail.com>
  • Loading branch information
Nindaleth and Black_Fox authored Oct 3, 2022
1 parent 28aca03 commit 9553cfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions game/ui/gamemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion game/ui/inventorymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9553cfc

Please sign in to comment.