Browse files

[fix] Make Gamepad Button Combo dialog work with remote controls. Fix…

…es #12733.
  • Loading branch information...
1 parent e6cb1e4 commit 6037f25dfbc4c4a0403a3ac381619fe63c80fc8c @killdash9 killdash9 committed with Jonathan Marshall Jul 25, 2012
Showing with 18 additions and 3 deletions.
  1. +18 −3 xbmc/dialogs/GUIDialogGamepad.cpp
View
21 xbmc/dialogs/GUIDialogGamepad.cpp
@@ -45,7 +45,11 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
if ((action.GetButtonCode() >= KEY_BUTTON_A &&
action.GetButtonCode() <= KEY_BUTTON_RIGHT_TRIGGER) ||
(action.GetButtonCode() >= KEY_BUTTON_DPAD_UP &&
- action.GetButtonCode() <= KEY_BUTTON_DPAD_RIGHT))
+ action.GetButtonCode() <= KEY_BUTTON_DPAD_RIGHT) ||
+ (action.GetID() >= ACTION_MOVE_LEFT &&
+ action.GetID() <= ACTION_MOVE_DOWN) ||
+ action.GetID() == ACTION_PLAYER_PLAY
+ )
{
switch (action.GetButtonCode())
{
@@ -61,7 +65,18 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
case KEY_BUTTON_DPAD_DOWN : m_strUserInput += "D"; break;
case KEY_BUTTON_DPAD_LEFT : m_strUserInput += "L"; break;
case KEY_BUTTON_DPAD_RIGHT : m_strUserInput += "R"; break;
- default : return true; break;
+ default:
+ switch (action.GetID())
+ {
+ case ACTION_MOVE_LEFT: m_strUserInput += "L"; break;
+ case ACTION_MOVE_RIGHT: m_strUserInput += "R"; break;
+ case ACTION_MOVE_UP: m_strUserInput += "U"; break;
+ case ACTION_MOVE_DOWN: m_strUserInput += "D"; break;
+ case ACTION_PLAYER_PLAY: m_strUserInput += "P"; break;
+ default:
+ return true;
+ }
+ break;
}
CStdString strHiddenInput(m_strUserInput);
@@ -81,7 +96,7 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
Close();
return true;
}
- else if (action.GetButtonCode() == KEY_BUTTON_START)
+ else if (action.GetButtonCode() == KEY_BUTTON_START || action.GetID() == ACTION_SELECT_ITEM)
{
m_bConfirmed = false;
m_bCanceled = false;

0 comments on commit 6037f25

Please sign in to comment.