NAME

X11::GUITest::record - Perl implementation of the X11 record extension.

VERSION

0.15

DESCRIPTION

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)

FEATURES

- 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)

SYNOPSIS

 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";

   }

DEPENDENCIES

To use this module please activate the record extension in the config of the X-Server:

- under selection "Module"
     Load         "record"

Please make sure that the display variable is set.

FUNCTIONS

Parameters enclosed within [] are optional.

SetRecordContext category, type, [category, type..]

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_DestroyWindow
- X_PolyText8
GetRecordInfo

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
 - {"Time"}          Server timestamp
[- {"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]
GetAllRecordInfo

Similar to GetRecordInfo but returns an array of hashes with all record information.

DisableRecordContext

Disables the record context.