keyUp

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.
 
  • To test if the Shift value (1) is set, use if shift.bitAnd(1) <> 0 then

 
  • To test if the Ctrl value (2) is set, use if shift.bitAnd(2) <> 0 then

 
  • To test if the Alt value (4) is set, use if shift.bitAnd(4) <> 0 then

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:

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.