From 5a2c9558f5f91836ab1877a9e97c802ed7bdd5de Mon Sep 17 00:00:00 2001 From: thrust26 Date: Wed, 1 May 2019 08:23:51 +0200 Subject: [PATCH] add tab widget navigation for R77 --- src/common/PKeyboardHandler.cxx | 5 +++-- src/gui/Dialog.cxx | 11 +++++++++++ src/gui/LauncherDialog.cxx | 18 +++++++++++------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 78b21373f..e43b514e8 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -195,8 +195,9 @@ void PhysicalKeyboardHandler::setDefaultMapping(Event::Type event, EventMode mod setDefaultKey( KBDK_F1, Event::UINavNext ); // front ("MODE") setDefaultKey( KBDK_F6, Event::UISelect ); // front ("SKILL P1") setDefaultKey( KBDK_F8, Event::UICancel ); // front ("SKILL P2") - setDefaultKey( KBDK_F13, Event::UIPgUp ); // back ("4:3","16:9")(redundant) - setDefaultKey( KBDK_BACKSPACE, Event::UIPgDown ); // back (FRY)(redundant) + //setDefaultKey( KBDK_F4, Event::NoType ); // back ("COLOR","B/W") + //setDefaultKey( KBDK_F13, Event::NoType ); // back ("4:3","16:9") + //setDefaultKey( KBDK_BACKSPACE, Event::NoType ); // back (FRY) #endif break; diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 2feaa68b8..c0556d883 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -416,6 +416,17 @@ void Dialog::handleKeyDown(StellaKey key, StellaMod mod) } } + // FIXME - use the R77 define in the final release + // use the '1' define for testing + #if defined(RETRON77) +// #if 1 + // special keys used for R77 + if (key == KBDK_F13 && cycleTab(-1)) + return; + if (key == KBDK_BACKSPACE && cycleTab(1)) + return; + #endif + // Check the keytable now, since we might get one of the above events, // which must always be processed before any widget sees it. if(e == Event::NoType) diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index f8b05b310..018567802 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -455,8 +455,11 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod) // Control-R (reload ROM listing) if(StellaModTest::isControl(mod) && key == KBDK_R) updateListing(); -//#ifdef RETRON77 // debugging only, FIX ME! - else if(myUseMinimalUI) + // FIXME - use the R77 define in the final release + // use the '1' define for testing + #if defined(RETRON77) +// #if 1 + else // handle keys used by R77 switch(key) { @@ -469,22 +472,23 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod) break; case KBDK_F11: // front ("LOAD") - // convert unused previous item key into page-up key - Dialog::handleKeyDown(KBDK_F13, mod); + // convert unused previous item key into page-up event + _focusedWidget->handleEvent(Event::UIPgUp); break; case KBDK_F1: // front ("MODE") - // convert unused next item key into page-down key - Dialog::handleKeyDown(KBDK_BACKSPACE, mod); + // convert unused next item key into page-down event + _focusedWidget->handleEvent(Event::UIPgDown); break; default: Dialog::handleKeyDown(key, mod); break; } -//#endif // debugging only, FIX ME! + #else else Dialog::handleKeyDown(key, mod); + #endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -