Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 71 additions & 47 deletions RetroFE/Source/RetroFE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1972,69 +1972,93 @@ RetroFE::RETROFE_STATE RetroFE::processUserInput( Page *page )
}

// Handle next/previous game inputs
if ( page->isHorizontalScroll( ) ) {
if (input_.keystate(UserInput::KeyCodeRight)) {
attract_.reset( );
if (infoExitOnScroll) {
resetInfoToggle();
if (page->isHorizontalScroll()) {
if (currentScrollState == NoScroll || currentScrollState == ItemScroll) {
if (input_.keystate(UserInput::KeyCodeRight)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = ItemScroll;
return RETROFE_SCROLL_FORWARD;
}
return RETROFE_SCROLL_FORWARD;
}
else if (input_.keystate(UserInput::KeyCodeLeft)) {
attract_.reset( );
if (infoExitOnScroll) {
resetInfoToggle();
else if (input_.keystate(UserInput::KeyCodeLeft)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = ItemScroll;
return RETROFE_SCROLL_BACK;
}
return RETROFE_SCROLL_BACK;
}
// playlist scroll
if (input_.keystate(UserInput::KeyCodeDown)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
if (currentScrollState == NoScroll || currentScrollState == PlaylistScroll) {
// playlist scroll
if (input_.keystate(UserInput::KeyCodeDown)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = PlaylistScroll;
return RETROFE_SCROLL_PLAYLIST_FORWARD;
}
return RETROFE_SCROLL_PLAYLIST_FORWARD;
}
else if (input_.keystate(UserInput::KeyCodeUp)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
else if (input_.keystate(UserInput::KeyCodeUp)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = PlaylistScroll;
return RETROFE_SCROLL_PLAYLIST_BACK;
}
return RETROFE_SCROLL_PLAYLIST_BACK;
}
}
else {
// vertical
if (input_.keystate(UserInput::KeyCodeDown)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
if (currentScrollState == NoScroll || currentScrollState == ItemScroll) {
if (input_.keystate(UserInput::KeyCodeDown)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = ItemScroll;
return RETROFE_SCROLL_FORWARD;
}
return RETROFE_SCROLL_FORWARD;
}
else if (input_.keystate(UserInput::KeyCodeUp)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
else if (input_.keystate(UserInput::KeyCodeUp)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = ItemScroll;
return RETROFE_SCROLL_BACK;
}
return RETROFE_SCROLL_BACK;
}
// playlist scroll
if (input_.keystate(UserInput::KeyCodeRight)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
if (currentScrollState == NoScroll || currentScrollState == PlaylistScroll) {
// playlist scroll
if (input_.keystate(UserInput::KeyCodeRight)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = PlaylistScroll;
return RETROFE_SCROLL_PLAYLIST_FORWARD;
}
return RETROFE_SCROLL_PLAYLIST_FORWARD;
}
else if (input_.keystate(UserInput::KeyCodeLeft)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
else if (input_.keystate(UserInput::KeyCodeLeft)) {
attract_.reset();
if (infoExitOnScroll) {
resetInfoToggle();
}
currentScrollState = PlaylistScroll;
return RETROFE_SCROLL_PLAYLIST_BACK;
}
return RETROFE_SCROLL_PLAYLIST_BACK;
}
}

// Reset currentScrollState when no key is pressed
if (!input_.keystate(UserInput::KeyCodeUp) &&
!input_.keystate(UserInput::KeyCodeDown) &&
!input_.keystate(UserInput::KeyCodeLeft) &&
!input_.keystate(UserInput::KeyCodeRight)) {
currentScrollState = NoScroll;
}

// don't wait for idle
if (currentTime_ - keyLastTime_ > keyDelayTime_) {
Expand Down
9 changes: 8 additions & 1 deletion RetroFE/Source/RetroFE.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <Windows.h>
#endif


class CollectionInfo;
class Configuration;
class Page;
Expand Down Expand Up @@ -142,6 +141,14 @@ class RetroFE
RETROFE_SCROLL_PLAYLIST_BACK,
};

enum SCROLLSTATE {
NoScroll,
ItemScroll,
PlaylistScroll
};

SCROLLSTATE currentScrollState = NoScroll;

void render();
bool back( bool &exit );
bool isStandalonePlaylist(std::string playlist);
Expand Down