Intercepting keys in callback()

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

    • Intercepting keys in callback()

      Hi

      In my project there is no touchscreen but an external keyboard. Want to intercept key ESCAPE (0x1b) when a DROPDOWN widget has focus. Apparently function callback() never is triggered when key ESCAPE is pressed. How to sove this ?

      Regards
    • Hi,

      This is kind of tricky, because there are two things to consider. First is, after clicking the DROPDOWN widget the listbox will get the focus and therefore the DROPDWON won't receive any key messages once it is expanded. The other one is that the LISTBOX is created dynamically and it is not easy to set callback for the LISTBOX of the DROPDOWN widget.

      Attached is an example on how you could do it anyway. I have set a callback for the DROPDOWN widget. It only checks if a LISTBOX is present and if it is it sets a callback to the LISTBOX.

      The callback of the LISTBOX reacts on key messages and collapse the DROPDOWN if the escape key has been pressed.

      Regards
      Sven
      Files
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.