Keyboard(3pm)

πŸ“¦
version 1.4 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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 true keysym-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 $

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