keyUp(keyCode: Integer io; (Form) shift: Integer); keyUp(control: control-type input; (Control) keyCode: Integer io; shift: Integer);
The keyUp event occurs when the user releases a key while an object has the focus. (To interpret ANSI characters, use the keyPress event.)
The keyUp event uses the parameters listed in the following table.
Argument | Description |
---|---|
keyCode | A key code; for example, J_key_F1 (F1 key) or J_key_Home (Home key). |
shift | The state of the Shift, Ctrl, and Alt keys when the key was pressed. This integer is a combination of values, as follows. |
|
|
|
|
|
You can use the Window class constants listed in the following table to test the state of the Alt, Ctrl, and Shift keys of the shift parameter.
Window Class Constant | Bit Value |
---|---|
KeyState_Alt | #4 |
KeyState_Ctrl | #2 |
KeyState_Shift | #1 |
The keyUp event of the Form class first receives all keystrokes for all controls, followed by the object with the focus. Although the keyUp event can apply to most keys, it is most often used for:
Extended character keys such as function keys
Navigation keys
Combinations of keys with standard keyboard modifiers
Distinguishing between the numeric keypad and regular number keys
Use the Window class enableEvent method to control at run time whether JADE logic associated with an event for a specific form or control is executed.
You could use this method in thin client mode, for example, to speed up the data entry process for a TextBox control by disabling the keyUp event. (Event methods can be enabled or disabled in standard client mode and in thin client mode.)
Use the keyUp event for keyboard handlers if you need to respond to releasing a key.
Changing the keyCode parameter only effects the Form class. For control classes, Windows has already predetermined the actions taken.
For details about the context menu event that occurs after the keyUp event, see the contextMenu event method. If a called window does not implement the contextMenu event, the default processing continues.