L_RETURNKEY

Set the return state of privatized keys

WSupported on Windows

 

 

 

xcall L_RETURNKEY(list_id, [key_code, return][, ...])

Arguments

list_id

The ID of the list. (n)

key_code

(optional) One or more of the virtual key codes (defined in tools.def): (n)

D_VKUP = Up Arrow key.

D_VKDOWN = Down Arrow key.

D_VKLEFT = Left Arrow key.

D_VKRIGHT = Right Arrow key.

D_VKPRIOR = Page Up key.

D_VKNEXT = Page Down key.

D_VKHOME = Home key.

D_VKEND = End key.

return

(optional) One of the following flags: (n)

TRUE = The key should be returned out of the list.

FALSE = The key should be private to the list. (default)

Discussion

L_RETURNKEY enables you to use keys that are privatized for lists as menu entry shortcuts. (On Unix and OpenVMS, this routine is ignored because all keys are returned and can potentially be used as shortcuts to menu entries.)

By default, privatized keys, which correspond to the key codes listed above, will not signal menu entries when in a list on Windows, but will instead perform their privatized functions for the list. (See Appendix C: Keyboard Navigation for Lists on Windows for details.) To circumvent the privatized behavior of a key and make the key available as a menu entry shortcut, set return to TRUE for the key.

To use one of the reserved privatized keys as a menu entry shortcut, call L_RETURNKEY before testing g_entnam for the menu. In the L_RETURNKEY call, pass the corresponding key code followed by TRUE. For example:

xcall l_returnkey(listid, D_VKUP, TRUE)

To reset a key’s behavior to its privatized function (and let the list handle the key), pass the key code followed by FALSE. For example:

xcall l_returnkey(listid, D_VKUP, FALSE)

You can call this subroutine multiple times for the same list and/or key, contextually altering the behavior of a key within your application.

Examples

The following example specifies that for listid, the HOME and END keys are available to the application and may be mapped to menu entries. The up arrow and down arrow keys, on the other hand, have their usual behavior of being interpreted immediately by the list control. The other unspecified virtual keys will have their behavior unchanged.

xcall l_returnkey(listid, D_VKHOME, TRUE, D_VKEND, TRUE, D_VKUP, FALSE, D_VKDOWN, FALSE)