X11::Xlib - Low-level access to the X11 library
use X11::Xlib; my $display = X11::Xlib->new(); ...
This module provides low-level access to X11 libary functions.
This includes access to some X11 extensions like the X11 test library (Xtst).
Instantiate a new X11::Xlib object. This object contains the connection to the X11 display.
X11::Xlib
The $display variable specifies the display adress to open. If unset, the $DISPLAY environement variable is used.
$display
$DISPLAY
Return the width of screen number $screen (or 0 if not specified).
$screen
Return the height of screen number $screen (or 0 if not specified).
Fake a mouse movement on screen number $screen to position $x,$y.
$x
$y
The optional $EventSendDelay parameter specifies the number of milliseconds to wait before sending the event. The default is 10 milliseconds.
$EventSendDelay
Simulate an action on mouse button number $button. $pressed indicates whether the button should be pressed (true) or released (false).
$button
$pressed
The optional $EventSendDelay parameter specifies the number of milliseconds ro wait before sending the event. The default is 10 milliseconds.
Simulate a event on any key on the keyboard. $kc is the key code (8 to 255), and $pressed indicates if the key was pressed or released.
$kc
Make the X server emit a sound.
Return an array of the key codes currently pressed on the keyboard.
Return a mask value for the currently-lit keyboard LEDs.
Flush pending events sent via the Fake* methods to the X11 server.
This method must be used to ensure the fake events take are triggered.
Force the X server to sync event. The optional $flush parameter allows pending events to be discarded.
$flush
Return the key code corresponding to the character number $keysym.
$keysym
Return an array of character numbers corresponding to the key $keycode.
$keycode
Each value in the array corresponds to the action of a key modifier (Shift, Alt).
$count is the number of the keycode to return. The default value is 1, e.g. it returns the character corresponding to the given $keycode.
$count
Return an X11::Xlib::Window object corresponding to the X11 root window.
Return the human-readable string for character number $keysym.
XKeysymToString is the exact reverse of XStringToKeysym.
XKeysymToString
XStringToKeysym
Return the keysym number for the human-readable character $string.
$string
XStringToKeysym is the exact reverse of XKeysymToString.
Return true if $keysym is a function key (F1 .. F35)
Return true if $keysym is on numeric keypad.
Return true is key if... honestly don't know :\
Return true if $keysym is a modifier key (Shift, Alt).
No idea.
Again, no idea.
This module provides the same functions but with a high level approach.
Functions provided by X11/Xlib are mostly included in the Gtk2 binding, but through the GTK API and perl objects.
This module is still incomplete, but patches are welcome :)
Olivier Thauvin, <nanardon@nanardon.zarb.org>
Copyright (C) 2009-2010 by Olivier Thauvin
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install X11::Xlib, copy and paste the appropriate command in to your terminal.
cpanm
cpanm X11::Xlib
CPAN shell
perl -MCPAN -e shell install X11::Xlib
For more information on module installation, please visit the detailed CPAN module installation guide.