Only run input code when input is pressed, not released.

This commit is contained in:
Aloshi 2013-12-20 15:09:35 -06:00
parent ed64c22dcb
commit bec3a2599a

View file

@ -43,39 +43,42 @@ void GridGameListView::setCursor(FileData* file)
bool GridGameListView::input(InputConfig* config, Input input) bool GridGameListView::input(InputConfig* config, Input input)
{ {
if(config->isMappedTo("a", input)) if(input.value != 0)
{ {
if(mGrid.getList().size() > 0) if(config->isMappedTo("a", input))
{ {
FileData* cursor = getCursor(); if(mGrid.getList().size() > 0)
if(cursor->getType() == GAME)
{ {
mWindow->getViewController()->launch(cursor); FileData* cursor = getCursor();
}else{ if(cursor->getType() == GAME)
// it's a folder
if(cursor->getChildren().size() > 0)
{ {
mCursorStack.push(cursor); mWindow->getViewController()->launch(cursor);
populateList(cursor); }else{
// it's a folder
if(cursor->getChildren().size() > 0)
{
mCursorStack.push(cursor);
populateList(cursor);
}
} }
}
return true;
}
}else if(config->isMappedTo("b", input))
{
if(mCursorStack.size())
{
populateList(mCursorStack.top()->getParent());
mGrid.setCursor(mCursorStack.top());
mCursorStack.pop();
mTheme->playSound("backSound");
}else{
mGrid.stopScrolling();
mWindow->getViewController()->goToSystemSelect();
}
return true; return true;
} }
}else if(config->isMappedTo("b", input))
{
if(mCursorStack.size())
{
populateList(mCursorStack.top()->getParent());
mGrid.setCursor(mCursorStack.top());
mCursorStack.pop();
mTheme->playSound("backSound");
}else{
mGrid.stopScrolling();
mWindow->getViewController()->goToSystemSelect();
}
return true;
} }
return GameListView::input(config, input); return GameListView::input(config, input);
} }