diff options
author | wm4 <wm4@nowhere> | 2013-12-13 00:19:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-13 00:19:17 +0100 |
commit | b0bd93cbc18032dde6abb42cbc3068e906622e48 (patch) | |
tree | c645527986f85a5ea735ff81c2fcd0115651489b /mpvcore | |
parent | 88432b817d0ca115ff97ec76065f1dabcb5f9137 (diff) | |
download | mpv-b0bd93cbc18032dde6abb42cbc3068e906622e48.tar.bz2 mpv-b0bd93cbc18032dde6abb42cbc3068e906622e48.tar.xz |
dvdnav: support mouse interaction
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/player/dvdnav.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mpvcore/player/dvdnav.c b/mpvcore/player/dvdnav.c index 879bacd1c1..6efa786996 100644 --- a/mpvcore/player/dvdnav.c +++ b/mpvcore/player/dvdnav.c @@ -100,9 +100,22 @@ void mp_nav_user_input(struct MPContext *mpctx, char *command) struct mp_nav_state *nav = mpctx->nav_state; if (!nav) return; - struct mp_nav_cmd inp = {MP_NAV_CMD_MENU}; - inp.u.menu.action = command; - stream_control(mpctx->stream, STREAM_CTRL_NAV_CMD, &inp); + if (strcmp(command, "mouse_move") == 0) { + struct mp_image_params vid = {0}; + if (mpctx->d_video) + vid = mpctx->d_video->decoder_output; + struct mp_nav_cmd inp = {MP_NAV_CMD_MOUSE_POS}; + int x, y; + mp_input_get_mouse_pos(mpctx->input, &x, &y); + osd_coords_to_video(mpctx->osd, vid.w, vid.h, &x, &y); + inp.u.mouse_pos.x = x; + inp.u.mouse_pos.y = y; + stream_control(mpctx->stream, STREAM_CTRL_NAV_CMD, &inp); + } else { + struct mp_nav_cmd inp = {MP_NAV_CMD_MENU}; + inp.u.menu.action = command; + stream_control(mpctx->stream, STREAM_CTRL_NAV_CMD, &inp); + } } void mp_handle_nav(struct MPContext *mpctx) |