Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

prima::keyselector(3) [debian man page]

Prima::KeySelector(3)					User Contributed Perl Documentation				     Prima::KeySelector(3)

NAME
Prima::KeySelector - key combination widget and routines DESCRIPTION
The module provides a standard widget for selecting a user-defined key combination. The widget class allows import, export, and modification of key combinations. The module provides a set of routines, useful for conversion of a key combination between representations. SYNOPSIS
my $ks = Prima::KeySelector-> create( ); $ks-> key( km::Alt | ord('X')); print Prima::KeySelector::describe( $ks-> key ); API
Properties key INTEGER Selects a key combination in integer format. The format is described in "Hot key" in Prima::Menu, and is a combination of "km::XXX" key modifiers and either a "kb::XXX" virtual key, or a character code value. The property allows almost, but not all possible combinations of key constants. Only "km::Ctrl", "km::Alt", and "km::Shift" modifiers are allowed. Methods All methods here can ( and must ) be called without the object syntax; - the first parameter must not be neither package nor widget. describe KEY Accepts KEY in integer format, and returns string description of the key combination in human readable format. Useful for supplying an accelerator text to a menu. print describe( km::Shift|km::Ctrl|km::F10); Ctrl+Shift+F10 export KEY Accepts KEY in integer format, and returns string with a perl-evaluable expression, which after evaluation resolves to the original KEY value. Useful for storing a key into text config files, where value must be both human readable and easily passed to a program. print 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 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 "KeyDown" in Prima::Widget event: code, key, and modifier. USE_CTRL is only relevant when KEY first byte ( "KEY & 0xFF" ) is between 1 and 26, what means that the key is a combination of an alpha key with the control key. If USE_CTRL is 1, code result is unaltered, and is in range 1 - 26. Otherwise, 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. perl v5.14.2 2009-02-24 Prima::KeySelector(3)

Check Out this Related Man Page

Prima::EventHook(3)					User Contributed Perl Documentation				       Prima::EventHook(3)

NAME
Prima::EventHook - event filtering SYNOPSIS
use Prima::EventHook; sub hook { my ( $my_param, $object, $event, @params) = @_; ... print "Object $object received event $event "; ... return 1; } Prima::EventHook::install( &hook, param => $my_param, object => $my_window, event => [qw(Size Move Destroy)], children => 1 ); Prima::EventHook::deinstall(&hook); DESCRIPTION
Prima dispatches events by calling notifications registered on one or more objects interested in the events. Also, one event hook can be installed that would receive all events occurred on all objects. "Prima::EventHook" provides multiplex access to the core event hook and introduces set of dispatching rules so the user hook subs receive only a defined subset of events. The filtering criteria are event names and object hierarchy. API
install SUB, %RULES Installs SUB into hook list using hash of RULES. The SUB is called with variable list of parameters, formed so first passed parameters from 'param' key ( see below ), then event source object, then event name, and finally parameters to the event. SUB must return an integer, either 0 or 1, to block or pass the event, respectively. If 1 is returned, other hook subs are called; if 0 is returned, the event is efficiently blocked and no hooks are further called. Rules can contain the following keys: event Event is either a string, an array of strings, or "undef" value. In the latter case it is equal to '*' string, which selects all events to be passed in the SUB. A string is either name of an event, or one of pre-defined event groups, declared in %groups package hash. The group names are: ability focus geometry keyboard menu mouse objects visibility These contain respective events. See source for detailed description. In case 'event' key is an array of strings, each of the strings is also name of either an event or a group. In this case, if '*' string or event duplicate names are present in the list, SUB is called several times which is obviously inefficient. object A Prima object, or an array of Prima objects, or undef; the latter case matches all objects. If an object is defined, the SUB is called if event source is same as the object. children If 1, SUB is called using same rules as described in 'object', but also if the event source is a child of the object. Thus, selecting "undef" as a filter object and setting 'children' to 0 is almost the same as selecting $::application, which is the root of Prima object hierarchy, as filter object with 'children' set to 1. Setting together object to "undef" and children to 1 is inefficient. param A scalar or array of scalars passed as first parameters to SUB whenever it is called. deinstall SUB Removes the hook sub for the hook list. NOTES
"Prima::EventHook" by default automatically starts and stops Prima event hook mechanism when appropriate. If it is not desired, for example for your own event hook management, set $auto_hook to 0. AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. SEE ALSO
Prima, Prima::Object perl v5.14.2 2009-02-24 Prima::EventHook(3)
Man Page