IUP_K_ANY

IUP - Portable User Interface

K_ANY

Action generated when a keyboard event occurs.

Callback

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

self: identifier of the element where the user typed something.
c: identifier of typed key. Please refer to the Keyboard Codes table for a list of possible values.

If the function returns IUP_IGNORE, the system will ignore the typed character.

If returns IUP_CONTINUE, the event will be propagated to the parent of the element receiving it.

If returns IUP_DEFAULT is terminated normally.

If returns the code of any other key, IUP will treat this new key instead of the one typed by the user.

Notes

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 do not work in IupLua.

The K_ANY callback is a callback that depends on the keyboard focus and the keyboard usage of the control with the focus. It is usually only set for dialogs, but if a control set the K_ANY callback the dialog callback will only be called if the control callback returns IUP_CONTINUE.

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

Affects

All elements with user interaction.