|
|
Thanks for the code and the suggestions. I will experience with the code and see if I can get it to work out.
Btw. another question. Would it be possible to activate the callback of a Fl_Button due to the "roller-mouse-button" ?
Would be most convenient in my application !
Best regards
onsdag 9. september 2020 kl. 20:32:23 UTC+2 skrev Greg Ercolano:
On 2020-09-09 11:09, Greg Ercolano wrote:
> Trouble is, as I predicted in my last post, when the menu posts, it steals keyboard
> focus, which would be bad if triggered on keypresses from the user typing into the
> input field.
>
> So for instance when I run the above app, and start typing into the input field before
> the 3 seconds expire, when the menu suddenly posts, I can no longer keep typing.
You can maybe avoid that by taking a copy of the Fl_Input_Choice code, and making
your own derived class for the Fl_Menu_Button so that you can implement your own
handle() method that throws the typing events back to the Fl_Input widget.
You /probably/ want the menu to handle /some/ of the keyboard events, like
up/down arrow keys to allow the user to navigate the menu, and trap the
Enter key if the user has one of the items highlighted so it 'picks' that
item and fills in the Fl_Input field.
Also would have to take into account the effects of a window manager that
might be "focus follows mouse", where keyboard focus goes to the widget
under the mouse, where ever that may be. So be sure to redirect focus()
when the popup appears, to make sure it's where you want it to be.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/3db54870-ef5d-4b0a-9a46-3fc632e17308n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |