Allow "KEY_ENTER" to exit command mode. Makes it a bit easier in some contexts.

This commit is contained in:
casey 2016-07-28 19:14:58 -07:00
parent 52843d1b82
commit 7dc629b4db

View File

@ -135,7 +135,8 @@ void MainLayout::SetMainLayout(std::shared_ptr<cursespp::LayoutBase> layout) {
bool MainLayout::KeyPress(const std::string& key) {
if (prefs->GetBool(box::prefs::keys::EscFocusesShortcuts)) {
if (key == "^[" ||
(key == "KEY_UP" && this->shortcutsFocused))
(key == "KEY_ENTER" && this->shortcutsFocused) ||
(key == "KEY_UP" && this->shortcutsFocused))
{
this->shortcutsFocused = !this->shortcutsFocused;