Built-in functions / Built-in functions |
Returns the key code of a logical or physical key.
FGL_KEYVAL( string STRING ) RETURNING result INTEGER
FGL_KEYVAL() can be used in form-related statements to examine a value returned by the FGL_LASTKEY() and FGL_GETKEY() functions.
Key names recognized by FGL_KEYVAL() are: ACCEPT, HELP, NEXT, RETURN, DELETE, INSERT, NEXTPAGE, RIGHT, DOWN, INTERRUPT, PREVIOUS, TAB, ESC, ESCAPE, LEFT, PREVPAGE, UP, F1 through F64, CONTROL-character (where character can be any letter except A, D, H, I, J, L, M, R, or X).
The function returns NULL if the parameter does not correspond to a valid key.
If you specify a single character, FGL_KEYVAL() considers the case. In all other instances, the function ignores the case of its argument, which can be uppercase or lowercase letters.
To determine whether the user has performed an action, such as inserting a row, specify the logical name of the action (such as INSERT) rather than the name of the physical key (such as F1). For example, the logical name of the Accept action is ACCEPT, while the default physical key is ESCAPE. To test if the key most recently pressed by the user corresponds to the Accept action, specify FGL_KEYVAL("ACCEPT") rather than FGL_KEYVAL("ESCAPE") or FGL_KEYVAL("ESC"). Otherwise, if a key other than ESCAPE is set as the Accept key and the user presses that key,FGL_LASTKEY() does not return a code equal to FGL_KEYVAL("ESCAPE").
This function is provided for backward compatibility especially for TUI mode applications. FGL_KEYVAL() is well supported in text mode, but this function can only be emulated in GUI mode, because the front-ends communicate with the runtime system with other events as keystrokes.