displayGetKey (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

DX4 pro, NX-400, LX4

Firmware version:

1.30 / 1.00.00


This waits for a key press from the display. The function waits for a maximum number of seconds, and if no key is pressed within the timeout period, the function returns a 0 which indicates the timeout. If a key press has been detected before the timeout period, a number identifying the actual key press is returned.

A small buffer is present in the system so that all key presses are received by the application.

 

Input:

timeout : INT

-1

- Waits forever until a key is pressed.

0

- Does not wait.

> 0

- Waits the specified number of second (max. 60).

 

Returns:

-2

- Invalid parameter.

-1

- Not supported.

0

- Timeout.

120

- Up arrow key pressed.

121

- Down arrow key pressed.

122

- Left arrow key pressed.

123

- Right arrow key pressed.

124

- OK key pressed.

125

- ESC key pressed.

126

- DEL key pressed.

127

- SEL key pressed.

200

- NX-400 only: Click happened on screen where there was no control to handle it.

201

- NX-400 only: Click happened on status bar where there was no control to handle it.

202

- NX-400/LX4 only: Backlight reduced due to inactivity. See displayPower for more information.

203

- NX-400/LX4 only: Activity has occurred; the backlight is restored.

 

Declaration:

FUNCTION displayGetKey : INT;
VAR_INPUT
  timeout : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  key : INT;
END_VAR;
 
BEGIN
  ...
  // Wait for key
  key := displayGetKey(timeout := 45);
  ...
END;
 
END_PROGRAM;