Contains the last keystroke or keystroke combination made by the user in the focused item, page, or form.
A keypress option is ignored if no keypress has been established at the level of focus. If the value of a keypress option is ignored at the item level, it passes up to the page level, and if ignored at the page level, it passes up to the form level. This option allows for the creation of a default button (shortcut key) on a page or a form.
This option is not saved or transmitted as part of the form. Instead, it is automatically created each time the form is read into memory, and is maintained only during display or processing.
<keypress>key pressed</keypress>
Parameter | Type | Description |
---|---|---|
Key pressed | ESC | escape key |
ENTER | enter key | |
NUMPAD_ ENTER | number pad enter key | |
" " | space bar | |
F[1-12] | function key (can be any key from F1 to F12) | |
any alphanumeric char | Any uppercase or lowercase alphanumeric key on the keyboard. For example 'd' or 'T'. | |
ALT/CTRL[a-z/A-Z] | Alt or Ctrl + any uppercase or lowercase
alpha key on the keyboard. For example 'Alt + G' or 'Ctrl + q' Notes:
|
button, field, combobox, popup, list, radio, check, page global, form global
The following example shows how you can set the keypress options to the Ctrl + G keys at the page global and global levels. When the form’s user presses the Ctrl + Shift + g keys, it activates the CancelButton’s cancel action and the text “You pressed Ctrl + G” is then displayed in the field and a save dialog box is displayed.
<button sid="CancelButton">
<type>cancel</type>
<value>Cancel</value>
<custom:myoption xfdl:compute="toggle(PAGE1.global.keypress, '', 'CTRL+g')
== '1' ?
set ('CancelButton.activated','on'): ''"></custom:myoption>
<custom:my xfdl:compute="toggle(global.global.keypress, '', 'CTRL+g')
== '1' ?
set ('FIELD1.value','You pressed Ctrl + G'): ''"></custom:my>
</button>
<label sid="FIELD1_LABEL1">
<itemlocation>
<x>3</x>
<y>57</y>
</itemlocation>
<value>Name</value>
</label>
<field sid="FIELD1">
<scrollhoriz>wordwrap</scrollhoriz>
<value></value>
</field>