Skip to content

Is it possible to send mouse interactions to the on-screen-controls via a command? #16531

Answered by SumOys
SumOys asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, I finally got it all working. First of all, I couldn't use the build-in osc as is. I copied the script and added in the following hook:

-- Custom for Media Hug
local function script_mouse_input(up_down)
  process_event("mbtn_left", up_down)
end
mp.register_script_message("osc-mouse-left-button-action", script_mouse_input)
-- End Customizations

I turned off the builtin osc and loaded my custom one:

        osc_script = pkg_resources.files('mediahug') / 'osc-custom.lua'
        self.log.info(f'Loading OSC Script: {osc_script}')
        self.player.command('load-script', osc_script)

    def get_mpv_player_implementation(self, current_volume, show_controls):
        return MPV(vo="l…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SumOys
Comment options

@hooke007
Comment options

@SumOys
Comment options

Answer selected by SumOys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants