Glimmr Form Fields
version 1/101201 by Erik Temple
Section: Control input
We can also set the "accepted control input" for each field in much the same way. The accepted control input is the list of keystrokes that the field will accept as control codes (such as return, enter, delete, and arrow keys); they are never displayed, but are used for other effects. Here is a nonexhaustive list of potential control keys:
-2 left arrow
-3 right arrow
-4 up arrow
-5 down arrow
-10 page up
-11 page down
By default, the accepted control input list contains the following codes:
-2, -3, 3, 127, -6, -7, -8, -9
These correspond to the keys for which default control behavior is available: The enter and return keys terminate input in a field, the escape key cancels input, the delete key deletes the character in front of the cursor, and the left & right arrow keys move the cursor within the field.
The actual behavior for control keys is defined in the "keypress-to-string conversion rules". Authors who need to define new control keys or to change the existing behaviors are referred to this extension's source code to study the implementation of the default behaviors.