X11::GUITest::record - Perl implementation of the X11 record extension.
0.11
This Perl package uses the X11 record extension to capture events (from X-server) and requests (from X-client). Futher it is possible to capture mostly all client/server communitation (partially implemented) For a full description of the extension see the Record Extension Protocol Specification of the X Consortium Standard (Version 11, Release 6.4)
- Recording mouse movements - Recording key presses and key releases - Getting information about created and closed windows - Getting text from windows (if it is a Poly8 request)
use X11::GUITest::record qw /:ALL :CONST/; # Query version of the record extension my $VERSION_EXT = QueryVersion; print "Record extension version: $VERSION_EXT\n"; # Sets the record context to capture key presses and mouse movements SetRecordContext(KeyPress, MotionNotify); # Begin record EnableRecordContext(); print "Recording..............\n"; sleep (5); # Stop record DisableRecordContext(); while ($data = GetRecordInfo()) { print "Record: ". $data ->{TxtType} ." "; print "X:". $data ->{X} . " Y:". $data ->{Y} if ($data ->{TxtType} eq "MotionNotify"); print "Key:". $data ->{Key} if ($data ->{TxtType} eq "KeyPress"); print "\n"; }
Parameters enclosed within [] are optional.
Specifies what the context has to record. It is possible to use the constant functions as:
SetRecordContext(KeyPress, KeyRelease, MotionNotify);
It is only possible to use DeliverdEvents and CoreRequests. To use other please choose one of the low level functions like SetDeviceEvents.
Some implemented events/requests are:
- KeyPress - KeyRelease - ButtonPress - ButtonRelease - MotionNotify - X_CreateWindow - X_PolyText8
To get one single record information from record queue.
This function will return 0 if the end of the queue is reached. Otherwise it will return a hash with the following values:
- {"Category"}: Category of the record (0 for event 1 for request) - {"Type"}: Type of the record in digits - {"TxtType"}: Type of the record in text [- {"X"} X coordinte] [- {"Y"} Y coordinte] [- {"Text"} Text if it is a X_Polytext8] [- {"Key"} Key if it is a key press or key release event] [- {"WinID"} WindowID] [- {"PWinID"} Parent WindowID]
Similar to GetRecordInfo but returns an array of hashes with all record information.
Disables the record context.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Specification'. Assuming UTF-8
To install X11::GUITest::record, copy and paste the appropriate command in to your terminal.
cpanm
cpanm X11::GUITest::record
CPAN shell
perl -MCPAN -e shell install X11::GUITest::record
For more information on module installation, please visit the detailed CPAN module installation guide.