Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[fix] Make Gamepad Button Combo dialog work with AppleTV - fixes #12733 #1217

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+16 −3
Split
@@ -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,16 @@ 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 +94,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;