-
I'm currently updating my mpv frontend to work with Wayland via OpenGL rendering (using python-mpv). I have the following In my X11 version, I could enable on screen controls (osc) and input was passed through via python-mpv directory to the mpv process. Using libmpv and the local mp = require 'mp'
local function display_osd_info()
info = mp.get_property("osd-dimensions")
mp.osd_message("OSD:" .. info)
print("OSD:" .. info)
local mouse_pos = mp.get_property_native("mouse-pos")
x = mouse_pos.x
y = mouse_pos.y
print("Mouse position - X:", x, "Y:", y)
mp.commandv("mouse", x, y, 0, "single")
end
mp.add_key_binding("k", "display_osd_info", display_osd_info) I obviously messed up here and confused OSD with OSC. I tried printing the OSD properties to figure out what's going on, but that's obviously the message in the top left, not the OSC. Is there a way to get OSC debugging information? Anyway, when I press Is it even possible to interact with the osc via the mpv API? I really like the osc and would rather not try to re-implement it in my Qt application. Also asked this on StackOverflow if anyone wants the internet points: https://stackoverflow.com/questions/79697620/is-it-possible-to-send-mouse-events-clicks-to-the-on-screen-controls-osc-in-an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
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:
I turned off the builtin osc and loaded my custom one: