September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
8
Task/Simulate-input-Mouse/Go/simulate-input-mouse.go
Normal file
8
Task/Simulate-input-Mouse/Go/simulate-input-mouse.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package main
|
||||
|
||||
import "github.com/go-vgo/robotgo"
|
||||
|
||||
func main() {
|
||||
robotgo.MouseClick("left", false) // single clicks left mouse button
|
||||
robotgo.MouseClick("right", true) // double clicks right mouse button
|
||||
}
|
||||
47
Task/Simulate-input-Mouse/Perl-6/simulate-input-mouse.pl6
Normal file
47
Task/Simulate-input-Mouse/Perl-6/simulate-input-mouse.pl6
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. | ||||