v14 Map Key ID to Run
#1
I used the Keymap Editor addon to find out exactly what Key ID my delete button is on my keyboard. It is 61575. I am trying to map that key id to run a certain function. I found the gen.xml file in my /userdata/keymaps folder so I thought I would just add the following function

<key id="61575">RunScript("/home/osmc/.kodi/userdata/switch.py")</key>

Unfortunately this is not working. Am I correct in adding it to the gen.xml file? Is it supposed to go somewhere else?

To debug, I ran `python /home/osmc/.kodi/userdata/switch.py` and the function worked as expected. Is RunScript() deprecated?

Thanks in advance for the help!
Reply
#2
I don't know about the RunScript,
but the location for the key addon is in /home/osmc/.kodi/userdata/keyboards/ in a file which should probably be called keyboard.xml or remote.xml.
You can find about this stuff in the kodi wiki.
Derek
Reply
#3
So I turned on debugging and pushed the delete button and it turns out the action is being invoked. But for some reason I do not have the desired output. Is there a way to have my python script output to the debugging file so I can add some print statements or something?

Here is a snippet of my log: http://pastebin.com/VcFGL17M
Reply
#4
(2015-06-29, 16:55)Abolfazl Wrote: Is there a way to have my python script output to the debugging file so I can add some print statements or something?

http://romanvm.github.io/xbmcstubs/docs/...e.html#log
Reply
#5
(2015-06-29, 17:33)asavah Wrote:
(2015-06-29, 16:55)Abolfazl Wrote: Is there a way to have my python script output to the debugging file so I can add some print statements or something?

http://romanvm.github.io/xbmcstubs/docs/...e.html#log

I did 'import xbmc' at the top and it said xbmc was not found. I thought xbmc can only be included from addons.
Reply

Logout Mark Read Team Forum Stats Members Help
Map Key ID to Run1