Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
wants to merge 2 commits into from

3 participants

@killdash9

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

@killdash9 killdash9 [fix] Make Gamepad Button Combo dialog work with AppleTV - fixes #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
9ec1155
@Memphiz
Owner

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.

@jmarshallnz
Owner

IMO we should just remove this dialog instead of implementing it for other devices.

Further, the code changes done don't apply only to the apple remote - they apply to any input device (so the comments are not correct).

@killdash9

The gamepad dialog is nicer than the number dialog in one sense because it allows a code to be entered much more efficiently and an observer watching the screen can determine the password with the number dialog, but not with the gamepad dialog.

@Memphiz
Owner

yep tested it ... now you also can use the gamepad combo with cursor keys and even with nyxboard (basically everything which uses these actions).

@jmarshallnz i though understand the reason for having a somewhat "cloaked" ability to enter a lock code...

@ghost

the amount of lines we (possibly) git rm does not matter. this looks fine, and is confirmed working. nuke the comments and we can merge for now and settle the fate of the dialog later by throwing bikesheds at each other (dibs on the orange with a -1 tint) or whatever ;)

@killdash9

I have removed Apple TV-specific comments.

@jmarshallnz jmarshallnz was assigned
@jmarshallnz
Owner

Thanks - will pull in with some minor changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 25, 2012
  1. @killdash9

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

    killdash9 authored
    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
Commits on Aug 8, 2012
  1. @killdash9

    Removed apple tv comments

    killdash9 authored
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 3 deletions.
  1. +16 −3 xbmc/dialogs/GUIDialogGamepad.cpp
View
19 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,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;
Something went wrong with that request. Please try again.