diff options
Diffstat (limited to 'backends/keymapper')
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 9 | ||||
-rw-r--r-- | backends/keymapper/remap-dialog.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index bf4144a59f..4b95a1a021 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -39,7 +39,7 @@ enum { }; RemapDialog::RemapDialog() - : Dialog("KeyMapper"), _keymapTable(0), _activeRemapAction(0), _topAction(0), _remapTimeout(0) { + : Dialog("KeyMapper"), _keymapTable(0), _activeRemapAction(0), _topAction(0), _remapTimeout(0), _topKeymapIsGui(false) { _keymapper = g_system->getEventManager()->getKeymapper(); assert(_keymapper); @@ -61,6 +61,8 @@ void RemapDialog::open() { const Stack<Keymapper::MapRecord> &activeKeymaps = _keymapper->getActiveStack(); if (activeKeymaps.size() > 0) { + if (activeKeymaps.top().keymap->getName() == Common::kGuiKeymapName) + _topKeymapIsGui = true; _kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Effective)")); divider = true; } @@ -325,6 +327,11 @@ void RemapDialog::loadKeymap() { int topIndex = activeKeymaps.size() - 1; + // This is a WORKAROUND for changing the popup list selected item and changing it back + // to the top entry. Upon changing it back, the top keymap is always "gui". + if (!_topKeymapIsGui && activeKeymaps[topIndex].keymap->getName() == kGuiKeymapName) + --topIndex; + // add most active keymap's keys Keymapper::MapRecord top = activeKeymaps[topIndex]; List<Action*>::iterator actIt; diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h index 1cb930bd42..143deca4cf 100644 --- a/backends/keymapper/remap-dialog.h +++ b/backends/keymapper/remap-dialog.h @@ -91,6 +91,8 @@ protected: bool _changes; + bool _topKeymapIsGui; + }; } // End of namespace Common |