logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

X11::Keyboard - Keyboard support functions for X11

Acknowledgements

       My gratitude to Benjamin Goldberg for his patience and direction in my struggles to put this together, as
       well as to Somni and dkr from the OPN #perl channel.

Author

       Erick Calder <ecalder@cpan.org>

Availability + Support

       For support e-mail the author.  This module may be found on the CPAN.  Additionally, both the module and
       its RPM package are available from:

       http://perl.arix.com

Date

       $Date: 2002/12/04 05:16:01 $

Description

       This module is meant to provide access to the keyboard functions of X11.  Whilst the functions names are
       essentially identical to those used in xlib (minus the prepended X), the parameter lists and return
       values are different as specified in this document.

Methods

       An object oriented interface is provided as follows:

   new<x-connection>
       Used to initialise the system, this method requires a handle to an X connection (typically generated
       using the X11::Protocol module) and returns an object instance.

   keysym-num=StringToKeysym[keysym-name=$_]
       This method requires a keysym name and returns its corresponding numeric value.  If no name is provided,
       $_ is used.

       -exempligratia-

        $c = $k->StringToKeysym("Backspace");
        # $c now contains 65288

   keycode[state]=KeysymToKeycode[keysym-[num|name]=$_]
       This method returns the keycode corresponding to the passed-in keysym name or number (if neither is
       passed $_ is used).  In such cases where the keysym name evaluates to a numeric value e.g. [0-9], the
       caller is responsible for first converting the value to a true keysym-num.

       The method can also return the associated state.  If the calling context is a list it is returned, if
       scalar, only the keycode is returned.

Name

       X11::Keyboard - Keyboard support functions for X11

Synopsis

        use X11::Protocol;
        use X11::Keyboard;

        $x = X11::Protocol->new();
        $k = X11::Keyboard->new($x);
        $keysym = $k->StringToKeysym("plus");
        print $k->KeysymToKeycode($keysym);

        # or, more simply
        print $k->KeysymToKeycode("plus");

Version

       $Revision: 1.4 $

See Also