Re: keyboard in context menus

[email protected] Wed, 12 Jul 2023 14:34:09 -0500
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
On 2023-07-12 13:15, Enno Rehling wrote:
> On 12-Jul-23 15:00, [email protected] wrote:
>> On 2023-07-11 13:45, Enno Rehling wrote:
>> 
>> I made a note of this problem.  The issue is difficult and may some
>> time to fix.
> 
> So it's not a problem with how I create my popup? At least that means
> I can stop trying to fix it :-) I forgot to mention this is with the
> stable version of Fox (1.6.57).
> 
>> Of course, the reason its not a widely expressed problem is that the
>> popup must have been popped up with the mouse, and thus one would
>> typically then use the mouse to use the popup menu, rather than
>> switch to the keyboard.
> 
> The same thing happens when I open the popup with the keyboard (I have
> a SEL_KEYPRESS handler that listens for Shift-F10).
> 
>> The problem is what happens if you have a sub-pupup.  Grabbing the
>> sub-popup would have to know where to revert the grab to when 
>> unpopped.
> 
> I don't have a sub-popup, I only have this one context menu, which
> does not spawn any further ones.
> 
>> However, some popup menus may be either poppup up via context right-
>> click, and sometimes from pulldown menu.
>> 
>> The pulldown menus get their key events delivered via the normal
>> focus-chain from the top-window.  There are some interactions.
> 
> Yes, cursor key navigation in FXMenuBar pulldown menus seems to work
> as expected. It's only when I open a menu with runModalWhileShown that
> it doesn't.
> 
> Enno.

It works from FXMenuBar, (actually, FXMenuTitle), because FXMenuTitle
gets the focus, and forwards key event to the panel.

A free-floating panel is a toplevel widget, but it normally doesn't
get focus (or become the active window).  Thus keystrokes aren't 
directed
to it.

A complication is that of mouse-grabs.  Mouse-grabs are in effect when 
the
mouse is outside the popup (so we can make it go away when clicking 
anywhere
on the screen).  Its debatable whether keyboard grabs should be used 
just
like mouse-grabs.  Maybe.  The code to do that was commented out in 
FXPopup
and there must have been a complication somewhere do make me comment it 
out.

     -- JVZ




_______________________________________________
Foxgui-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/foxgui-users