company logo

ControlContext :: keyEvent - Key event handler

The key event handler is called for each key pressed when the control has focus. The key event handler returns the result of key handling, when the key was handled successfully. When the key was not handled, the function should return an error (1) or -1 in order to indicate, that no action has been performed. Following successor actions are performed depending on the return code:

  • -1 (no action) - The system tries to locate other actions for the same control associated with the event.
  • 1 (error) - The system passes the event to the parent control.
  • 0 (ok) - The key event will not be handled further on.

When the key pressed should appear in the control area, the function must not return 0. When returning 0, any further action with the key pressed is suppressed.

Return value:  Return code for executing an action (function) ( int32  )

A return code -1 indicates, that the action was not executed and should be toggled to the next executing object.

A return code 0 indicates, that the function was terminated successfully.

All other return codes indicate an error.

Implementation details

int32 ControlContext  :: keyEvent ( odabagui::KeyInput &cKeyInput )
  • cKeyInput - Key input

    The key input object defines key and modifier key pressed recently on the keyboard.