Prima::KeySelector(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

✨ NAME ✨

okay bestie, this is Prima::KeySelector(3) and it's literally the manual for the key-combo widget and its routines.

Prima::KeySelector - key combination widget and routines

πŸ¦‹ DESCRIPTION πŸ¦‹

So Prima::KeySelector gives you the standard widget for selecting user-defined key combinations. The widget class allows import, export, and modification of key combinations. The module also provides a set of routines useful for the conversion of key combinations between various representations. no cap, it's giving utility icon behavior πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

my $ks = Prima::KeySelector-> create( );
$ks-> key( km::Alt | ord('X'));
print Prima::KeySelector::describe( $ks-> key );

πŸ’… API πŸ’…

This is the whole API, bestie β€” no skipping the β€œboring” parts, because none of it is boring. ✨

πŸ“ Properties πŸ“

πŸ’– key INTEGER πŸ’–

Selects a key combination in integer format. The format is described in "Hotkey" in Prima::Menu, and is a combination of the km::XXX key modifiers and is either a kb::XXX virtual key or a character code value.

The property allows almost, but not all possible combinations of key constants. Only the km::Ctrl, km::Alt, and km::Shift modifiers are allowed. periodt.

🌸 Methods 🌸

All methods must be called without the object as a first parameter. read that twice, bestie 🫢

πŸŽ€ describe KEY πŸŽ€

Accepts KEY in integer format and returns a string description of the key combination in a human-readable format. Useful for supplying an accelerator text to a menu.

print Prima::KeySelector::describe( km::Shift|km::Ctrl|km::F10);
Ctrl+Shift+F10

πŸ¦‹ export KEY πŸ¦‹

Accepts KEY in integer format and returns a string with a perl-evaluable expression, which after the evaluation resolves to the original KEY value. Useful for storing a key into text config files, where the value must be both human-readable and easily passed to a program.

print Prima::KeySelector::export( km::Shift|km::Ctrl|km::F10);
km::Shift|km::Ctrl|km::F10

🌈 shortcut KEY 🌈

Converts KEY from integer format to a string, acceptable by "Prima::AbstractMenu" input methods.

print Prima::KeySelector::shortcut( km::Ctrl|ord('X'));
^X

πŸ”₯ translate_codes KEY, [ USE_CTRL = 0 ] πŸ”₯

Converts KEY in integer format to three integers in the format accepted by the "KeyDown" in Prima::Widget event: code, key, and modifier. USE_CTRL is only relevant when the KEY first byte ( KEY & 0xFF ) is between 1 and 26, which means that the key is a combination of an alpha key with the control key. If USE_CTRL is 1, the code result is unaltered and is in range 1 - 26. Otherwise, the code result is converted to the character code ( 1 to ord('A'), 2 to ord('B'), etc ).

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Karasik, <dmitry@karasik.eu.org>.

🫢 SEE ALSO 🫢

Prima, Prima::Widget, Prima::Menu.


okay that's the whole page, and the footer tea is: perl v5.42.0, dated 2024-08-20 β€” mwah, byeee πŸ’‹πŸ’–

πŸ“¦ where this page comes from