Physical button execute script

@vpeter, @Portisch,
Hello, its that possible to made reboot to android command, map to one phisical button in the keymap editor/edit to keymap under CoreELEC?
I know its actually two command, I see that in the dialogbuttonmenu.
Maybe possible to made a script, and run to mapped button? Thanks

You can run python script from keyboard.xml file on some button press.

Start reading here for example.

Thanks for the links , I’m afraid my knowledge is little for make that proper…

Well, it is hard to give exact instructions if we don’t know your setup. For example what remote, did you made any adjustment, …

1 Like

Its normal Homatics remote, with flirc receiver, mapped the remote buttons to kodi.
Here ist my keymap.

<key id="61524">reboot</key>
<key id="61568">zoomin</key>
<key id="61569">playerprocessinfo</key>
<key id="61467">aspectratio</key>
<key id="61513">playerdebug</key>

I would like the reboot “61524” use to reboot to android instead.

Change key to

<key id="61524">RunScript(/storage/</key>

and then copy file to /storage.

You can do this manually or type this commands in ssh session

cd /tmp
mv /storage/

Reboot and check if works. If not enable kodi debug log and check inside for any errors.

If editing file /storage/.kodi/userdata/keymaps/keyboard.xml then XBMC.RunScript must be used.


import subprocess["/usr/sbin/rebootfromnand"], shell=True)["/usr/sbin/reboot"], shell=True)

1 Like
2023-04-30 15:38:30.944 T:1047    error <general>: Keymapping error: no such action 'xbmc.runscript(/storage/' defined
2023-04-30 15:38:30.945 T:1047     info <general>: Loading special://profile/keymaps/gen.xml
2023-04-30 15:38:30.945 T:1047    error <general>: Keymapping error: no such action 'xbmc.runscript(/storage/' defined

Instead of XBMC.RunScript try with RunScript only.

1 Like

Yes, that was the trick.
Works flawlessly :slight_smile:
Thanks for your time and help. :+1:

1 Like

Glad to help.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.