Is There Any General Interfaces on Linux to Simulate Mouse Movements and Click

Control mouse by writing to /dev/input/mice

this is not trough the file you mentioned, but its way quicker to use this tool instead of decypering the dump of that file. And it does everything you want in bash.

xdotool does the trick in my terminal.

this is the package site for ubuntu.
you probably can install it trough

# apt-get install xdotool

I could just emerge it on gentoo without adding any repositories.

the tool works fairly simple:

#! /bin/bash
# move the mouse x y
xdotool mousemove 1800 500
# left click
xdotool click 1
# right click
xdotool click 3

found it here

Controlling mouse in linux

In the end I decided to just draw "cursor" objects on the screen and use setup each input device to control a separate "cursor" object. This seemed the best idea as we were short on time.



Related Topics



Leave a reply



Submit