Capture keypress events
#1
I've been modifying an old xbmc plugin to work with gotham and i've got it pretty well sorted.

the problem is that it's a vod streaming plugin so fast forward and rewind don't work in the traditional sense. to fast forward, you need to send a request to the server saying where in the future you want to go. so what i'm wondering is: can i capture the fast forward button press with some kind of event server and send that url then switch to the new stream generated from the url returned?

or does xbmc not allow you to change the behaviour of keypresses?
Reply
#2
You can create a fake invisible window with its own event loop over fullscreen video. But there's a big problem: addon window event loop does not capture key events completely but still propagates them down to XBMC core.

Although, you can use different keys, not involved in playback control, to control your addon playback. Or you can create visible addon window with on-screen controls. But I'm afraid it won't be a transparent solution: you will need to press a separate key to launch your "video control addon" and then stop it when controlling is done.
Reply
#3
that's a disappointment. can i take control of the left and right dpad behaviours without having some janky solution for fast forward and reverse?
Reply
#4
(2014-04-24, 13:43)mrnagrom Wrote: that's a disappointment. can i take control of the left and right dpad behaviours without having some janky solution for fast forward and reverse?

Yes, I think you can bind some other keys not involved in controlling playback to the script which will be responsible for navigation in you video.
Something like that (see Wiki about keyboard.xml config file):
Code:
<some_key1>RunScript(<full_path_to_script>, forward)</some_key1>
<some_key2>RunScript(<full_path_to_script>, backward)</some_key2>
Script call parameters (forward/backward) are accessed via sys.argv list.
The only problem I see that you will need a separate script for controlling playback in your plugin.
Reply

Logout Mark Read Team Forum Stats Members Help
Capture keypress events0