Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- capture = {}
- local gp
- if mp.get_property == nil then
- gp = mp.property_get
- else
- gp = mp.get_property
- end
- function capture.handler()
- local c = capture
- local x, y = mp.get_mouse_pos()
- if c.trig then
- mp.commandv("show-text", string.format("координаты 2 x=%d ; y=%d", x, y))
- local f = assert(io.open("/tmp/webm_crop2", "w"))
- f:write(string.format("%d:%d", x, y))
- f:close()
- c.trig = nil
- else
- mp.commandv("show-text", string.format("координаты 1 x=%d ; y=%d", x, y))
- local f = assert(io.open("/tmp/webm_crop1", "w"))
- f:write(string.format("%d:%d", x, y))
- f:close()
- c.trig = 1
- end
- end
- mp.add_forced_key_binding("F10", capture.handler)
- if bindings_enabled then toggle_bindings(true, true) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement