From 7be6be826322f23f06b12b5d064e1028a9c9c114 Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 12 Jul 2009 22:09:21 +0000 Subject: [PATCH] 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 --- docs/index.html | 8 +++++++- src/common/Version.hxx | 2 +- src/emucore/Event.hxx | 2 +- src/emucore/EventHandler.cxx | 6 +++++- src/emucore/EventHandler.hxx | 2 +- src/gui/BrowserDialog.cxx | 1 + src/gui/LauncherDialog.cxx | 1 + src/gui/ListWidget.cxx | 4 ++++ src/gui/ListWidget.hxx | 3 ++- 9 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/index.html b/docs/index.html index 12b22ccf4..f1807cf3e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1953,7 +1953,13 @@ - Emulate 'frying' effect (*) + Emulate 'frying' effect (TIA mode) (*) + Backspace + Backspace + + + + Go to parent directory (UI mode) (*) Backspace Backspace diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 5836a507a..9d457cd96 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -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 diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx index 0b72aa36b..0a0b8fd66 100644 --- a/src/emucore/Event.hxx +++ b/src/emucore/Event.hxx @@ -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 }; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index deb41f6ad..9f15923ae 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -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 } }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 21aab8057..d868c2f62 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -402,7 +402,7 @@ class EventHandler private: enum { kEmulActionListSize = 75, - kMenuActionListSize = 13 + kMenuActionListSize = 14 }; // Structure used for action menu items diff --git a/src/gui/BrowserDialog.cxx b/src/gui/BrowserDialog.cxx index bd875ea19..8604528b0 100644 --- a/src/gui/BrowserDialog.cxx +++ b/src/gui/BrowserDialog.cxx @@ -211,6 +211,7 @@ void BrowserDialog::handleCommand(CommandSender* sender, int cmd, break; case kGoUpCmd: + case kListPrevDirCmd: _node = _node.getParent(); updateListing(); break; diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 521d5ea87..a18161e95 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -522,6 +522,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, break; case kPrevDirCmd: + case kListPrevDirCmd: myCurrentNode = myCurrentNode.getParent(); updateListing(); break; diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index 2973f37c3..b53f4b6da 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -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; } diff --git a/src/gui/ListWidget.hxx b/src/gui/ListWidget.hxx index 96fe302b2..c95a2ff34 100644 --- a/src/gui/ListWidget.hxx +++ b/src/gui/ListWidget.hxx @@ -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 */