diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-25 16:13:57 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-25 16:13:57 +0000 |
commit | 14c018a80f4908a6540e76e08047dcbf6d9dc059 (patch) | |
tree | 37cc35c4d060727a66a696bc677689bf6fda4c78 /libvo/video_out.c | |
parent | 38505822c7914c60fbbd003f00c4176500547444 (diff) | |
download | mpv-14c018a80f4908a6540e76e08047dcbf6d9dc059.tar.bz2 mpv-14c018a80f4908a6540e76e08047dcbf6d9dc059.tar.xz |
Avoid duplicating mouse-movement command-generation code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31091 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r-- | libvo/video_out.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index c1786d27ba..fdb75ba8fb 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -446,6 +446,21 @@ void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, stru dst->height = dst->bottom - dst->top; } +/** + * Generates a mouse movement message if those are enable and sends it + * to the "main" MPlayer. + * + * \param posx new x position of mouse + * \param posy new y position of mouse + */ +void vo_mouse_movement(int posx, int posy) { + char cmd_str[40]; + if (!enable_mouse_movements) + return; + snprintf(cmd_str, sizeof(cmd_str), "set_mouse_pos %i %i", posx, posy); + mp_input_queue_cmd(mp_input_parse_cmd(cmd_str)); +} + #if defined(CONFIG_FBDEV) || defined(CONFIG_VESA) /* Borrowed from vo_fbdev.c Monitor ranges related functions*/ |