Widget keyboard reaction

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Widget keyboard reaction

    It seems some of the widgets will react to either a key release or key press, for example the Edit/Spinbox only increments/decrements it's value on a up/down key release.
    Is there anyway of changing the Edit/Spinbox widgets to react on the press (rather than release), without changing the source code?
  • Hello,

    I am sorry, I partially misunderstood your request.

    The SPINBOX widget actually creates an EDIT widget, which then handles keyboard events. The SPINBOX itself just handles touch events, so the value is updated once a button was clicked. If you like to change the behavior of the handling of the key events, you can of course overwrite the callback function of the EDIT widget in order to be able to react to the WM_KEY message. Please use the function SPINBOX_GetEditHandle() to obtain the handle of the EDIT widget.

    Best regards,
    Adrian
  • Thanks Adrian,

    Inside the modified callback for the widget, how does one modify the keyboard reaction?
    Would I have to "trick" the widget by sending some sort of key press/release message events? Or would I have to use a function like EDIT_SetValue() to increment or decrement the value within an Edit widget?
  • Hello,

    In order to change a widget's reaction to a keyboard event, you will have to overwrite the callback function and implement a reaction to the WM_KEY message. Please find detailed information on how to do this in the section 15.2 "The Window Manager" -> "Callback mechanism, invalidation, rendering and keyboard input".

    Best regards,
    Adrian