Guia

IUP - Portable User Interface

Keyboard

Keyboard navigation is the dialog uses the "Tab" key to change the keyboard focus from one control to another. All IUP interactive controls have Tab stops, but the navigation order is related to the order the controls are placed in the dialog and can not be changed. When the focus is at a Multiline control to change focus the combination "Ctrl+Tab" must be used, because "Tab" is a valid character for the Multiline. The application can also control the focus using the functions: IupGetFocus, IupSetFocus, IupNextField and IupPreviousField. And when the focus is changed the application is notified trough the callbacks GETFOCUS_CB and KILLFOCUS_CB.

Two keys are also important in keyboard navigation: "Enter" and "Esc". But they are only active is the application register the attributes DEFAULTENTER and DEFAULTESC of the IupDialog. These attributes configure buttons to be activated when the respective key is pressed. Again "Enter" is a valid key for the Multiline so the combination "Ctrl+Enter" must be used instead. If the focus is at a button then the Enter key will activate this button independent from the DEFAULTENTER attribute.

Usualy the application will process keyboard input in the canvas using the KEYPRESS_CB callback. But there is also the K_ANY callback that can be used for all the controls, but it does not have control of the press state. Both callbacks use the key codification explained in Keyboard Codes. These codes are also used in the ACTION callbacks of IupText and IupMultiline, and in shortcuts for menu items and submenus using the KEY attribute of IupItem and IupSubmenu. Finally all the keyboard codes can be used as callback names to implement application hot keys.