mirror of https://github.com/stella-emu/stella.git
define tab cycling events and make tab cycling configurable
This commit is contained in:
parent
e015025d90
commit
a38f56fe91
|
@ -78,6 +78,7 @@ class Event
|
|||
|
||||
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
|
||||
UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir,
|
||||
UITabPrev, UITabNext,
|
||||
|
||||
LastType
|
||||
};
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
|
|
@ -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
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue