Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
I'm developing an add-on and I want to manage the events of a remote.
I want to run a python function if, for example, I've pressed on the tab button.
Can you help me ?
Thank you.
Posts: 2,078
Joined: Nov 2012
Reputation:
176
enen92
Team-Kodi Member
Posts: 2,078
Look at keymap editor addon code that is on the official repository. Probably you're trying to achive something that has already been done.
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
It's not that. I want to assign a key to a function in MY addon.
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
The second proposition is the good but I don't know how can I listen the keyboard as long as my add-on is running.
Thank you.
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
Can you give me an example, please ?
Thanks a lot.
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
I have a first version, it's this:
class KeyboardListener(WindowDialog):
def __init__(self):
self.key = None
WindowDialog.doModal(self)
self.urlChaines = urlChaines
def onInit(self):
"""initialisation"""
def onAction(self,action):
code = action.getButtonCode()
self.key = None if code == 0 else str(code)
self.key = str(self.key)
#conditions
self.close()
But the problem is: when I run the addon, I can catch the key actions, I can launch my function but I can't use the buttons on my addon.
Thanks
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
Can you help me please ?
How can I use this model while being able to move the cursor and click on the buttons ?
Please, help me !...
Thank you.
LitchiTheCat
Posts: 8
Joined: Sep 2014
Reputation:
0
Hi,
is there anybody have got the file "xbmcgui.py" ?