#!/usr/bin/perl #author: Chris Sincock #This software is provided as-is and is not guaranteed to be free of defects. Use it only at your own risk. #use lib $ENV{HOME}."/perl"; use X11::Protocol; my $x = X11::Protocol->new($ENV{DISPLAY} || ':0'); $x->event_handler('queue'); $x->AllowEvents('AsyncPointer', 'CurrentTime'); $x->GrabPointer($rootid, 1, $x->pack_event_mask('PointerMotion', 'PointerMotionHint', 'ButtonPress', 'ButtonRelease'), 'Asynchronous', 'Asynchronous', 'None', 'None', 'CurrentTime'); my ($focus_return,$revert_return)=$x->GetInputFocus($true); my %p = $x->QueryPointer(undef); print STDERR ::Dumper([%p]);