#!/usr/bin/env perl use v5.36; use strict; use X11::GUITest qw[GetMousePos MoveMouseAbs ClickMouseButton :CONST]; use Imager::Screenshot qw[screenshot]; my $w = 1920; my $h = 1080; checker(); sub checker { my $img = screenshot(); while(1) { my ($x, $y, $scr_num) = GetMousePos(); if($x < $w && $y < $h) { my ($r, $g, $b) = $img->getpixel(x => $x, y => $y)->rgba(); print join(' | ', $x, $y, $scr_num, $r, $g, $b), "\n"; } else { #print "\n"; } } }