Posts: 547
Joined: Nov 2011
Reputation:
8
hi guys, I need help. How do I detect a button press (of my Xbox Controller) in Python?
I need to use it as part of an if-condition. Basically this:
"if button b is pressed then ..."
Any ideas?
Thanks guys!
Posts: 547
Joined: Nov 2011
Reputation:
8
2020-07-26, 14:59
(This post was last modified: 2020-07-26, 14:59 by R.O.H.3000.)
I have already mapped my buttons. In this case it' not an option though.
I actually need the Python code which detects a button press.
Like I described above I need it as an if-condition.
What does the Python code look like for: "if button b is pressed"?
Posts: 547
Joined: Nov 2011
Reputation:
8
thank you! I need more help though. I tried the Kodi Callback add-on. (I knew it before and used it for other stuff.) It's not of any use for regarding pressing buttons.
I am still pretty much clueless what to do.
Posts: 547
Joined: Nov 2011
Reputation:
8
2020-08-01, 14:31
(This post was last modified: 2020-08-07, 00:52 by R.O.H.3000.)
I created a service add-on and used python inputs library. Finally it's working.
Appreciate your help!!
Posts: 1,664
Joined: Jun 2011
Reputation:
119
I've never worked with Python inputs library. From a Kodi addon perspective, an addon works with Kodi actions that can be mapped do different physical controller events, e.g. keypresses, touchscreen gestures etc. So I have no idea how to intercept actual controller events from an addon.
Posts: 547
Joined: Nov 2011
Reputation:
8
2020-08-11, 21:19
(This post was last modified: 2020-08-11, 21:20 by R.O.H.3000.)
no rant, just a simple realisation:
NOT one Team-Kodi Member was able to answer the simple question how to natively capture a button press.
Wow.
Mark the thread as solved, I guess.