diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx index b2bd65cae..54eb29594 100644 --- a/src/emucore/Event.hxx +++ b/src/emucore/Event.hxx @@ -78,6 +78,7 @@ class Event UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown, UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir, + UITabPrev, UITabNext, LastType }; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index bccaa9807..929ec248c 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -762,6 +762,10 @@ void EventHandler::setActionMappings(EventMode mode) prepend = "Tab (*)"; else if(event == Event::UINavPrev) prepend = "Shift + Tab (*)"; + else if (event == Event::UITabNext) + prepend = modifier + " + Tab (*)"; + else if (event == Event::UITabPrev) + prepend = modifier + " + Shift + Tab (*)"; else if(event == Event::UIPrevDir) prepend = "Backspace (*)"; // else if ... @@ -1425,6 +1429,8 @@ EventHandler::ActionList EventHandler::ourMenuActionList[MENU_ACTIONLIST_SIZE] = { Event::UINavPrev, "Previous object", "", false }, { Event::UINavNext, "Next object", "", false }, + { Event::UITabPrev, "Previous tab", "", false }, + { Event::UITabNext, "Next tab", "", false }, { Event::UIPrevDir, "Parent directory", "", false } }; diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 5ee949c7f..b56164766 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -364,7 +364,7 @@ class EventHandler COMBO_SIZE = 16, EVENTS_PER_COMBO = 8, EMUL_ACTIONLIST_SIZE = 83 + COMBO_SIZE, - MENU_ACTIONLIST_SIZE = 14 + MENU_ACTIONLIST_SIZE = 16 ; /** diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 5a2dc4c8c..d5c6f1d5e 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -442,10 +442,10 @@ void Dialog::handleKeyDown(StellaKey key, StellaMod mod) if(StellaModTest::isControl(mod)) { // tab header navigation - if(StellaModTest::isShift(mod) && cycleTab(-1)) - return; - else if(!StellaModTest::isShift(mod) && cycleTab(+1)) - return; + if(StellaModTest::isShift(mod)) + e = Event::UITabPrev; + else + e = Event::UITabNext; } else { @@ -456,16 +456,15 @@ void Dialog::handleKeyDown(StellaKey key, StellaMod mod) e = Event::UINavNext; } } - // FIXME - use the R77 define in the final release // use the '1' define for testing - #if defined(RETRON77) -// #if 1 + // #if defined(RETRON77) + #if 1 // special keys used for R77 - if (key == KBDK_F13 && cycleTab(-1)) - return; - if (key == KBDK_BACKSPACE && cycleTab(1)) - return; + else if (key == KBDK_F13) + e = Event::UITabPrev; + else if (key == KBDK_BACKSPACE) + e = Event::UITabNext; #endif // Check the keytable now, since we might get one of the above events, @@ -669,6 +668,16 @@ bool Dialog::handleNavEvent(Event::Type e) { switch(e) { + case Event::UITabPrev: + if (cycleTab(-1)) + return true; + break; + + case Event::UITabNext: + if (cycleTab(1)) + return true; + break; + case Event::UINavPrev: if(_focusedWidget && !_focusedWidget->wantsTab()) {