[Concept,08/16] mouse: Place mouse in the middle of the display
Commit Message
When starting the expo, put the mouse in the middle of the display so it
is more visible to the user.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/input/mouse-uclass.c | 2 ++
include/mouse.h | 2 ++
2 files changed, 4 insertions(+)
@@ -97,6 +97,8 @@ int mouse_set_video(struct udevice *dev, struct udevice *video_dev)
if (video_dev) {
uc_priv->video_width = video_get_xsize(video_dev);
uc_priv->video_height = video_get_ysize(video_dev);
+ uc_priv->last_pos.x = uc_priv->video_width / 2;
+ uc_priv->last_pos.y = uc_priv->video_height / 2;
} else {
uc_priv->video_width = 0;
uc_priv->video_height = 0;
@@ -168,6 +168,8 @@ int mouse_set_ptr_visible(struct udevice *dev, bool visible);
* Sets up the video device in the mouse uclass private data so mouse drivers
* can scale coordinates to match the display resolution.
*
+ * This also places the mouse in the middle of the display
+ *
* @dev: Mouse device
* @video_dev: Video device
* Returns: 0 if OK, -ve on error