summaryrefslogtreecommitdiff
path: root/components/rtgui/server/mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/rtgui/server/mouse.c')
-rw-r--r--components/rtgui/server/mouse.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/rtgui/server/mouse.c b/components/rtgui/server/mouse.c
index 27972af2b2..0fff8f101c 100644
--- a/components/rtgui/server/mouse.c
+++ b/components/rtgui/server/mouse.c
@@ -255,6 +255,10 @@ void rtgui_mouse_moveto(int x, int y)
rtgui_mouse_show_cursor();
#endif
}
+
+#ifdef RTGUI_USING_HW_CURSOR
+ rtgui_cursor_set_position(_rtgui_cursor->cx, _rtgui_cursor->cy);
+#endif
}
#ifdef RTGUI_USING_MOUSE_CURSOR
@@ -262,6 +266,17 @@ void rtgui_mouse_moveto(int x, int y)
#endif
}
+void rtgui_mouse_set_position(int x, int y)
+{
+ /* move current cursor */
+ _rtgui_cursor->cx = x;
+ _rtgui_cursor->cy = y;
+
+#ifdef RTGUI_USING_HW_CURSOR
+ rtgui_cursor_set_position(_rtgui_cursor->cx, _rtgui_cursor->cy);
+#endif
+}
+
#ifdef RTGUI_USING_MOUSE_CURSOR
void rtgui_mouse_set_cursor_enable(rt_bool_t enable)
{