Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python XBMCAddon::xbmcgui::Window::onAction() action.getButtonCode() #23789

Merged
merged 1 commit into from Oct 14, 2023

Conversation

icr8ions
Copy link
Contributor

@icr8ions icr8ions commented Sep 20, 2023

Description

  • changes to populate buttonCode for CAction such that it is available for python addons with custom controllers

Motivation and context

  • addons such as Keymap Editor do not work with custom controllers as the code being returned is the default value 0

How has this been tested?

  • successfully built on MacOS 11.5.2 and tested on MacOS 11.5.2 and 12.6 - functionality of Keymap Editor has been restored for custom controllers
  • thread: https://forum.kodi.tv/showthread.php?tid=356730&pid=3166711#pid3166711
    not working snippet:
    2023-09-18 12:51:19.178 T:3131545   debug : EventClient: button code 194 pressed
    2023-09-18 12:51:19.178 T:3131545   debug : EventClient: button code 194 released
    2023-09-18 12:51:19.186 T:3131425   debug : EventServer: key 194 translated to action ActivateWindow(Programs)
    2023-09-18 12:51:19.187 T:3131425   debug : Activating window ID: 10001
    2023-09-18 12:51:19.187 T:5238372   debug : action.getButtonCode(): 0
    working snippet:
    2023-09-20 11:34:16.696 T:5759207   debug : EventClient: button code 194 pressed
    2023-09-20 11:34:16.697 T:5759207   debug : EventClient: button code 194 released
    2023-09-20 11:34:16.725 T:5758980   debug : EventServer: key 194 translated to action ActivateWindow(Programs)
    2023-09-20 11:34:16.725 T:5758980   debug : Activating window ID: 10001
    2023-09-20 11:34:16.725 T:5759731   debug : action.getButtonCode(): 194

What is the effect on users?

  • should allow end-users to use Keymap Editor to regain functionality of their custom remotes and controllers

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@icr8ions icr8ions force-pushed the onaction-buttoncode branch 4 times, most recently from 9993afa to f941ba5 Compare September 20, 2023 18:22
…ode()

* changes to populate buttonCode for CAction such that it is available for python addons with custom controllers
@icr8ions
Copy link
Contributor Author

icr8ions commented Sep 20, 2023

Looks like the build is picking up old code - not the most recent push.
Action.h used to have two constructors with a similar signature on line 26 and 31. At this time there is no constructor on line 31 so I am wondering why stale pushes are sticking around for the build.

Why would the PR build be picking up stale code? The line numbers in the errors for a file do not match the actual commit.

Action.h snippet:
26 CAction(int actionID,
27 float amount1 = 1.0f,
28 float amount2 = 0.0f,
29 const std:: string& name = "",
30 unsigned int holdTime = 0,
31 unsigned int buttonCode = 0);
32 CAction(int actionID, wchar_t unicode);

error in recent builds:
/home/jenkins/jenkins-root/workspace/android-arm-docker@2/xbmc/input/actions/Action.h:26:3: note: candidate constructor
CAction(int actionID,
^
/home/jenkins/jenkins-root/workspace/android-arm-docker@2/xbmc/input/actions/Action.h:31:3: note: candidate constructor
CAction(int actionID,
^

@sundermann
Copy link
Contributor

That can happen sometimes if you force push while jenkins is trying to build your PR

@sundermann
Copy link
Contributor

Jenkins build this please

@sundermann sundermann added Type: Fix non-breaking change which fixes an issue Component: Input v21 Omega labels Sep 20, 2023
@sundermann sundermann added this to the Omega 21.0 Beta 1 milestone Sep 20, 2023
@icr8ions
Copy link
Contributor Author

Any chances of getting this merged into Nexus as well?

Copy link
Member

@enen92 enen92 left a comment

Choose a reason for hiding this comment

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

Change makes sense and should cause no harm.
Better to use initializer lists but that's out of the scope of your fix attempt.

@enen92 enen92 merged commit c1e5da9 into xbmc:master Oct 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Input Type: Fix non-breaking change which fixes an issue v21 Omega
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants