On 03/21/15 12:24,
dori...@gmail.com wrote:
> Have lots of widgets in my app (designed in Fluid). The keyboard key 'O' is defined as a shortcut on one of my buttons. That button is not always visible. Is it possible to make 'O' work (i.e. execute the callback), even when it is not displayed? Thanks.
One way would be to derive a class for the window and make a handle()
method for it that looks for the FL_SHORTCUT event, and if Fl::event_key()
is the "O", trigger the button's callback via button->do_callback().
Or something like that.
FL_SHORTCUT should be received only if no other widget wants the event
(i.e. input text fields which, if they have focus, will get the keystroke instead)