K_ANY

IUP - Portable User Interface

K_ANY

Action generated when a keyboard event occurs.

Callback

int function(Ihandle *ih, int c); [in C]
elem:k_any() -> (ret: number) [in Lua]

ih: identifier of the element that activated the event.
c: identifier of typed key. Please refer to the Keyboard Codes table for a list of possible values.

Return: If IUP_IGNORE is returned the key is ignored by the system. IUP_CLOSE will be processed. If returns IUP_CONTINUE, the event will be propagated to the parent of the element receiving it. Dialog "K_*" callbacks depend on this return value on child control "K_*" callbacks. If returns IUP_DEFAULT the key is processed but it is not propagated.

Notes

Keyboard callbacks depend on the keyboard usage of the control with the focus.

If the callback does not exists it is automatically propagated to the parent of the element.

K_* callbacks

All defined keys are also callbacks of any element, called when the respective key is activated. For example: "K_cC" is also a callback activated when the user press Ctrl+C, when the focus is at the element. This is the way an application can create shortcut keys, also called hot keys. These callbacks are not available in IupLua.

Affects

All elements with keyboard interaction.