Added 'Go to previous directory' event to the UI. Currently, this is

mapped to Backspace, and is used in the ROM launcher and various
BrowserWidgets.  The event can be remapped if desired.  When I'm
testing Stella, I tend to use the keyboard almost exclusively, and
it was getting a little tiring to reach for the mouse each time I
wanted to change directories.

Bumped version number.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1836 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-07-12 22:09:21 +00:00
parent ece68bb0b6
commit 7be6be8263
9 changed files with 23 additions and 6 deletions

View File

@ -1953,7 +1953,13 @@
</tr>
<tr>
<td>Emulate 'frying' effect (*)</td>
<td>Emulate 'frying' effect (TIA mode) (*)</td>
<td>Backspace</td>
<td>Backspace</td>
</tr>
<tr>
<td>Go to parent directory (UI mode) (*)</td>
<td>Backspace</td>
<td>Backspace</td>
</tr>

View File

@ -19,7 +19,7 @@
#ifndef VERSION_HXX
#define VERSION_HXX
#define STELLA_BASE_VERSION "2.8.4"
#define STELLA_BASE_VERSION "2.8.5_svn"
#ifdef NIGHTLY_BUILD
#define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD

View File

@ -73,7 +73,7 @@ class Event
Fry, VolumeDecrease, VolumeIncrease,
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UISelect, UINavPrev, UINavNext, UIOK, UICancel,
UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir,
LastType
};

View File

@ -1544,6 +1544,8 @@ void EventHandler::setDefaultKeymap(EventMode mode)
myKeyTable[ SDLK_RETURN ][mode] = Event::UISelect;
myKeyTable[ SDLK_ESCAPE ][mode] = Event::UICancel;
myKeyTable[ SDLK_BACKSPACE ][mode] = Event::UIPrevDir;
break;
default:
@ -2311,7 +2313,9 @@ EventHandler::ActionList EventHandler::ourMenuActionList[kMenuActionListSize] =
{ Event::UISelect, "Select item", 0 },
{ Event::UINavPrev, "Previous object", 0 },
{ Event::UINavNext, "Next object", 0 }
{ Event::UINavNext, "Next object", 0 },
{ Event::UIPrevDir, "Parent directory", 0 }
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -402,7 +402,7 @@ class EventHandler
private:
enum {
kEmulActionListSize = 75,
kMenuActionListSize = 13
kMenuActionListSize = 14
};
// Structure used for action menu items

View File

@ -211,6 +211,7 @@ void BrowserDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kGoUpCmd:
case kListPrevDirCmd:
_node = _node.getParent();
updateListing();
break;

View File

@ -522,6 +522,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kPrevDirCmd:
case kListPrevDirCmd:
myCurrentNode = myCurrentNode.getParent();
updateListing();
break;

View File

@ -345,6 +345,10 @@ bool ListWidget::handleEvent(Event::Type e)
_selectedItem = _list.size() - 1;
break;
case Event::UIPrevDir:
sendCommand(kListPrevDirCmd, _selectedItem, _id);
break;
default:
handled = false;
}

View File

@ -38,7 +38,8 @@ enum {
kListItemDataChangedCmd = 'LIch', // item data changed - 'data' will be item index
kListItemRClickedCmd = 'LIrc', // right click on item - 'data' will be item index
kListSelectionChangedCmd = 'Lsch', // selection changed - 'data' will be item index
kListScrolledCmd = 'Lscl' // list scrolled - 'data' will be current position
kListScrolledCmd = 'Lscl', // list scrolled - 'data' will be current position
kListPrevDirCmd = 'Lpdr' // request to go to parent list, if applicable
};
/** ListWidget */