I had this problem myself. The number of button presses you need to get from zero volume to full is 90. If you want 10% meaning you want zero to full in 10 steps. You need to make a script that does 9 volumeup presses and map that script to the button. I like having 6 steps so I made a script that sends volumeup/volumedown 15 times.(also on openelec)
First make the script for volumeup and volumedown
create a file, call it volumeup.py
inside the file place this code
Code:
import xbmc
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
you'll also need a script for volume down
create another file call it volumedown.py
place this inside the file
Code:
import xbmc
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
Once you saved them you would need to place them inside the userdata folder
/storage/.xbmc/userdata
(I use filezilla to transfer the files into my pi)
now you would need to know how to map actions to keys
this may help
http://kodi.wiki/view/Keymap
unless you already know how to do that
but I'll give you an idea. you need to create a file and called it remote.xml
inside the file you would have code that looks something like
Code:
<keymap>
<global>
<remote>
<volumeplus>RunScript(/storage/.xbmc/userdata/volumeup.py)</volumeplus>
<volumeminus>RunScript(/storage/.xbmc/userdata/volumedown.py)</volumeminus>
</remote>
</global>
</keymap>
this all depends on the keynames of you button that you press (if that page doesn't help, hopefully someone will chime in). xbmc might see your keyname as something else, but this is default name for volume up buttons
so where I put
<volumeplus>RunScript(/storage/.xbmc/userdata/volumeup.py)</volumeplus>
the keyname is "volumeplus" if you was showing a different keyname then it would be
<keyname>RunScript(/storage/.xbmc/userdata/volumeup.py)</keyname> (repplacing "keyname" with whatever yours is called)
after you created remote.xml and saved it you would need to place this inside keymaps folder
/storage/.xbmc/userdata/keymaps
then reboot and it should work i.e when you press volume up it executes your volumeup script telling xbmc to press volume up 9 times (or volumedown 9 times)
I'm using this on a pi and there is a delay of about a second from pressing a button and getting my action done, on more capable hardware I except this to be a none issue. but it works and I know if I want half the volume I only press volumedown 3 times on my remote, wait a second and xbmc does the rest.
notes
some remtoes are seen as keyboards to xbmc. so when creating the remote.xml you should rename it to keyboard.xml
also you would need to change a few things in the file. so where ever I put remote you would replace it with keyboard.
It sounds like alot but its not really.I don't come on that often but if you get stuck and no one comes in to help I'll reply but not sure when. good luck
P.S. I wrote a little guide on how to find out what the name of the keys on your remote
http://forums.tvaddons.ag/threads/7920-M...-ONE-CLICK
the site is down at the moment but once its back up that will help you plug the holes