[openbox] "Enter" key in menu

Dana Jansens dana at orodu.net
Mon Nov 8 20:24:31 EST 2010


On Mon, Nov 8, 2010 at 3:11 PM, Alexey Korop <akorop at gmail.com> wrote:
>
> Dana Jansens wrote:
>>
>> Thanks Alexey.  I've commited a change to fix the Enter behaviour.
>
>    Sorry, but Your patch introduced a new bug. Now after selection a submenu by keyboard accelerator, a child menu is expanded but not activated.

Thanks, fixed this.

>    I would like You to apply my patch as is instead of Your last correction. It is working properly, and besides, there is another reason not to combine the processing "Right" and "Enter".

Your patch pointed out to me a problem in the code, in that some code
to "exec" an entry was on key release, and some was on key press.  I'd
like to keep it more consistent, so now showing submenus is always
done on the press.  Only execing actions for a menu entry is done on
release (so that the key does not prevent keyboard grabs by other
apps).

> I have already prepared a patch which adds long awaiting submenu with default choice, with different works of this keys ("Enter" execute a default item, "Right" expand a submenu). I held this big patch because I wanted to first resolve the small issue with Enter, which affects the same part of the program text.

How would you run such a default action without using the keyboard ?


- Dana

>> On Mon, Nov 8, 2010 at 10:11 AM, Alexey Korop <akorop at gmail.com
>> <mailto:akorop at gmail.com>> wrote:
>>       In the 3.5 rc, after the submenu show delay for the keyboard
>>    navigation was improved, the behavior of the "Enter" key was very
>>    strange: "Enter" does nothing while submenu is not expanded.
>>       IMHO this is a bug, and the correct behavior of the "Enter" key
>>    must be the same as of the "Right" key, i.e. to expand and select
>>    the submenu.
>>        Correction if very simple
>>
>
>>    --- /mnt/i/linux/dana/openbox.git/openbox/event.c 2010-11-04
>>    16:12:42.000000000 +0200
>>    +++ ./openbox/event.c   2010-11-08 12:49:50.000000000 +0200
>>    @@ -1892,6 +1897,9 @@
>>                 }
>>
>>                 else if (sym == XK_Return || sym == XK_KP_Enter) {
>>    +                if (frame->selected &&
>>    +                    frame->selected->entry->type ==
>>    OB_MENU_ENTRY_TYPE_SUBMENU)
>>    +                   menu_frame_select(frame, frame->selected, TRUE);
>>                     frame->press_doexec = TRUE;
>>                     ret = TRUE;
>>                 }
>>
>>    This patch based on the "work" branch.
>
> _______________________________________________
> openbox mailing list
> openbox at icculus.org
> http://icculus.org/mailman/listinfo/openbox


More information about the openbox mailing list