Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
47
Task/Simulate-input-Mouse/Raku/simulate-input-mouse.raku
Normal file
47
Task/Simulate-input-Mouse/Raku/simulate-input-mouse.raku
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
use X11::libxdo;
|
||||
my $xdo = Xdo.new;
|
||||
|
||||
my ($dw, $dh) = $xdo.get-desktop-dimensions( 0 );
|
||||
|
||||
sleep .25;
|
||||
|
||||
for ^$dw -> $mx {
|
||||
my $my = (($mx / $dh * τ).sin * 500).abs.Int + 200;
|
||||
$xdo.move-mouse( $mx, $my, 0 );
|
||||
my ($x, $y, $window-id, $screen) = $xdo.get-mouse-info;
|
||||
my $name = (try $xdo.get-window-name($window-id) if $window-id)
|
||||
// 'No name set';
|
||||
|
||||
my $line = "Mouse location: x=$x : y=$y\nWindow under mouse:\nWindow ID: " ~
|
||||
$window-id ~ "\nWindow name: " ~ $name ~ "\nScreen #: $screen";
|
||||
|
||||
print "\e[H\e[J", $line;
|
||||
sleep .001;
|
||||
}
|
||||
|
||||
say '';
|
||||
|
||||
#`[ There are several available routines controlling mouse position and button events. | ||||