Alien-GvaScript

 view release on metacpan or  search on metacpan

doc/html/KeyMap.html  view on Meta::CPAN

fire the same handler, you can insert a <code>REGEX</code> entry in the map.
This should be an array of triplets, where each triplet is of shape
<code>[modifiers, regex, handler]</code>, like for example</p>
<pre>  var regexRules = [["C_",   "[0-9]",             myCtrlDigitHandler],
                    ["C_S_", /^[AEIOU]$/,         myCtrlShiftVowelHandler],
                    [null,   "RETURN|TAB|ESCAPE", someOtherHandler]   ];</pre>

<p>Whenever a key event is received, it is converted into a keyname, and 
then that keynames is compared against the regex rules, in order : the 
first rule that matches calls the corresponding handler and terminates
the event handling process.</p>
<p>More specifically, the members of rule triplets are :</p>
<ul>
<li><a name="item_modifiers"></a><b>modifiers</b>
<p>A string specifiying the key modifiers for which the rule will fire;
the string a concatenation of <b>C_</b>, <b>S_</b> and <b>A_</b>, as explained above.
An empty string means that the rule only fires when no modifiers
are pressed. By contrast, a <code>null</code> value specifies that
modifiers are ignored (the rule fires in any case).</p>
</li>
<li><a name="item_regex"></a><b>regex</b>

lib/Alien/GvaScript/KeyMap.pod  view on Meta::CPAN

This should be an array of triplets, where each triplet is of shape
C<[modifiers, regex, handler]>, like for example

  var regexRules = [["C_",   "[0-9]",             myCtrlDigitHandler],
                    ["C_S_", /^[AEIOU]$/,         myCtrlShiftVowelHandler],
                    [null,   "RETURN|TAB|ESCAPE", someOtherHandler]   ];

Whenever a key event is received, it is converted into a keyname, and 
then that keynames is compared against the regex rules, in order : the 
first rule that matches calls the corresponding handler and terminates
the event handling process.

More specifically, the members of rule triplets are :

=over

=item modifiers

A string specifiying the key modifiers for which the rule will fire;
the string a concatenation of B<C_>, B<S_> and B<A_>, as explained above.
An empty string means that the rule only fires when no modifiers



( run in 0.361 second using v1.01-cache-2.11-cpan-8d75d55dd25 )