Binding a script addon to a key on install
#1
I am developing a small script addon to do a "binary search" style seek when playing a video to more easily skip to the start of the show or past an advertisement.

I would like to be able to bind this to a key when the addon is installed. (Currently I am using the  KeyMap Editor addon to do this, but that seems awkward for a user of my addon to setup)

Is it possible to add a keymap section via an addon, or something similar, maybe in code. to add something like:
<keymap>
    <FullscreenVideo>
        <keyboard>
            <key id='2'>RunAddon(com.shartrec.skipit)</key>
        </keyboard>
    </FullscreenVideo>
</keymap>
Reply
#2
You could look at the Keymap editor code to see how it creates the keymap file.  The thing is, you are trying to insert a keymap, and keymap editor backups and replaces the current keymap file.  So you'd need to add some additional logic to make sure the keymap you are setting doesn't conflict with one that already exists.  You will continue to have a problem though.  If anyone ever uses Keymap Editor, it would replace the keymap file with what you added with a new one.  So you might have to add yet more logic that doesn't show the ability to add a keymap from your addon if Keymap editor is installed.

Honestly, your probably better off just including instructions on how to use Keymap editor.
Reply
#3
Thanks.
I had read the Keymap Editor code and came to much the same conclusion. Was hoping I might have missed something obvious elsewhere.   Sad
Reply

Logout Mark Read Team Forum Stats Members Help
Binding a script addon to a key on install0