Keyboard(3pm)
π Keyboard(3pm) β X11::Keyboard π
okay bestie, so this is the manual for X11::Keyboard β keyboard support functions for X11. it's a Perl module, she's giving utility, she's giving access, and she's here to let you talk to your keyboard at the X11 level. let's get into it π
β¨ NAME β¨
X11::Keyboard β Keyboard support functions for X11. that's it, that's the girl π
πΈ 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");
likeβ¦ look at her go. set up an X connection, wrap it, and suddenly you're converting keysyms and keycodes like it's nothing. periodt. β¨
π¦ DESCRIPTION π¦
so the whole point of this module is to give you access to the keyboard functions of X11. and here's the tea: the function names are basically identical to the ones in xlib β just minus the X that xlib prepends. iconic, love that for us.
BUT β and this is the important part, no cap β the parameter lists and return values are different, and they're specified right here in this document. so don't go assuming xlib habits carry over, bestie. read the doc. π
π METHODS π
An object oriented interface is provided as follows:
π new <x-connection>
this one initialises the whole system. it needs a handle to an X connection β typically something you generated using the X11::Protocol module β and it returns an object instance. your lil baby object. so cute. π«Ά
π« keysym-num = StringToKeysym [keysym-name = $_]
give this method a keysym name and it hands you back the corresponding numeric value. and if you don't pass a name at all? it just uses $_. lowkey convenient. π
- exempli gratia -
$c = $k->StringToKeysym("Backspace");
# $c now contains 65288
see? 65288. that's the number. she ate. π₯
π§ keycode [state] = KeysymToKeycode [keysym-[num|name] = $_]
this method returns the keycode corresponding to the keysym name or number you pass in. and if you pass neither? it uses $_. main character energy, honestly.
β οΈ okay important caveat bestie: in cases where the keysym name evaluates to a numeric value, e.g.[0-9], the caller is responsible for first converting that value to a truekeysym-num. so like, that's on you, not the module. don't come for her. π
and plot twist β this method can also return the associated state. how does it decide? by your calling context:
- if the calling context is a list β the state is returned too π
- if the calling context is scalar β only the keycode is returned
so, y'know. context matters. as always. π
π AUTHOR π
Erick Calder <ecalder@cpan.org> π
π 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. legends, all of them. π«Άβ¨
β 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
go get her. π
π DATE π
$Date: 2002/12/04 05:16:01 $
π₯ VERSION π₯
$Revision: 1.4 $
π LICENSE AND COPYRIGHT π
Copyright (c) 2002 Erick Calder. this product is distributed under the MIT License. a copy of this license was included in a file called LICENSE. and if for some reason that file was not included, please see:
http://www.opensource.org/licenses/mit-license.html
to obtain a copy of this license. k thanks bye, legal besties π
and that's the whole page, babes π
this was Keyboard(3pm), generated by perl v5.28.1 on 2019-02-04 β mwah, go convert some keysyms, you've got this π¦β¨π
π¦ where this page comes from
- debian bookworm: libx11-keyboard-perl 1.4-7 Β· MIT
- debian trixie: libx11-keyboard-perl 1.4-7 Β· MIT
- ubuntu jammy: libx11-keyboard-perl 1.4-7 Β· MIT
- ubuntu noble: libx11-keyboard-perl 1.4-7 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms