Skip to content

Commit

Permalink
[fix] Make Gamepad Button Combo dialog work with AppleTV - fixes xbmc…
Browse files Browse the repository at this point in the history
…#12733

The Apple TV remote does not work in the Gamepad Dialog. I've added support for the up/down/left/right/OK buttons on the apple remote to work with the Gamepad Dialog.

http://trac.xbmc.org/ticket/12733
  • Loading branch information
killdash9 committed Jul 25, 2012
1 parent 8d978da commit 9ec1155
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions xbmc/dialogs/GUIDialogGamepad.cpp
Expand Up @@ -45,7 +45,12 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
if ((action.GetButtonCode() >= KEY_BUTTON_A && if ((action.GetButtonCode() >= KEY_BUTTON_A &&
action.GetButtonCode() <= KEY_BUTTON_RIGHT_TRIGGER) || action.GetButtonCode() <= KEY_BUTTON_RIGHT_TRIGGER) ||
(action.GetButtonCode() >= KEY_BUTTON_DPAD_UP && (action.GetButtonCode() >= KEY_BUTTON_DPAD_UP &&
action.GetButtonCode() <= KEY_BUTTON_DPAD_RIGHT)) action.GetButtonCode() <= KEY_BUTTON_DPAD_RIGHT) ||
// AppleTV Remote Control Actions
(action.GetID() >= ACTION_MOVE_LEFT &&
action.GetID() <= ACTION_MOVE_DOWN) ||
action.GetID() == ACTION_PLAYER_PLAY
)
{ {
switch (action.GetButtonCode()) switch (action.GetButtonCode())
{ {
Expand All @@ -61,7 +66,17 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
case KEY_BUTTON_DPAD_DOWN : m_strUserInput += "D"; break; case KEY_BUTTON_DPAD_DOWN : m_strUserInput += "D"; break;
case KEY_BUTTON_DPAD_LEFT : m_strUserInput += "L"; break; case KEY_BUTTON_DPAD_LEFT : m_strUserInput += "L"; break;
case KEY_BUTTON_DPAD_RIGHT : m_strUserInput += "R"; break; case KEY_BUTTON_DPAD_RIGHT : m_strUserInput += "R"; break;
default : return true; break; default :
switch (action.GetID())
{
// AppleTV Remote Control actions
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); CStdString strHiddenInput(m_strUserInput);
Expand All @@ -81,7 +96,7 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
Close(); Close();
return true; 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_bConfirmed = false;
m_bCanceled = false; m_bCanceled = false;
Expand Down

1 comment on commit 9ec1155

@Memphiz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx - next time you don't need to do a new pull request - you can change your old branch and force push to your repo - this would automatically update the pull request then with your changes. Will attach this PR to the august merge window.

Please sign in to comment.