lkml.org 
[lkml]   [2013]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/3] mconf: handle keys in empty dialogs
    Date
    From: Dirk Gouders <dirk@gouders.net>

    When entering an empty dialog, using the movement keys resulted in
    unexpected characters beeing displayed, other keys like "z" and "h"
    did not work as expected.

    This patch handles the movement keys as well as other keys, especially
    "z", "h" and "/".

    Signed-off-by: Dirk Gouders <dirk@gouders.net>
    [yann.morin.1998@free.fr: keep lines <80 chars, so reorder test]
    Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
    Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
    Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
    ---
    scripts/kconfig/lxdialog/menubox.c | 9 +++++----
    scripts/kconfig/mconf.c | 11 ++++++-----
    2 files changed, 11 insertions(+), 9 deletions(-)

    diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
    index 48d382e..38cd69c 100644
    --- a/scripts/kconfig/lxdialog/menubox.c
    +++ b/scripts/kconfig/lxdialog/menubox.c
    @@ -303,10 +303,11 @@ do_resize:
    }
    }

    - if (i < max_choice ||
    - key == KEY_UP || key == KEY_DOWN ||
    - key == '-' || key == '+' ||
    - key == KEY_PPAGE || key == KEY_NPAGE) {
    + if (item_count() != 0 &&
    + (i < max_choice ||
    + key == KEY_UP || key == KEY_DOWN ||
    + key == '-' || key == '+' ||
    + key == KEY_PPAGE || key == KEY_NPAGE)) {
    /* Remove highligt of current item */
    print_item(scroll + choice, choice, FALSE);

    diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
    index 387dc8d..a69cbd7 100644
    --- a/scripts/kconfig/mconf.c
    +++ b/scripts/kconfig/mconf.c
    @@ -670,11 +670,12 @@ static void conf(struct menu *menu, struct menu *active_menu)
    active_menu, &s_scroll);
    if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
    break;
    - if (!item_activate_selected())
    - continue;
    - if (!item_tag())
    - continue;
    -
    + if (item_count() != 0) {
    + if (!item_activate_selected())
    + continue;
    + if (!item_tag())
    + continue;
    + }
    submenu = item_data();
    active_menu = item_data();
    if (submenu)
    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-05-30 01:01    [W:3.797 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site