Prima::KeySelector(3)
β¨ 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
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms