From cda2fc734378c733f93249958975df55366e8543 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 9 May 2023 21:50:35 +0100 Subject: Add Alt-h and Alt-l keybindings. --- doc/tofi.1.md | 3 ++- doc/tofi.1.scd | 4 ++-- src/input.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/tofi.1.md b/doc/tofi.1.md index 7af587b..79d6ce2 100644 --- a/doc/tofi.1.md +++ b/doc/tofi.1.md @@ -41,11 +41,12 @@ the form **--key=value**. # KEYS \ \| \ \| \-k \| \-p \| \-k \| \-p +\| \-h > Move the selection back one entry. \ \| \ \| \-j \| \-n \| \-j \| -\-n \| \ +\-n \| \-l \| \ > Move the selection forward one entry. diff --git a/doc/tofi.1.scd b/doc/tofi.1.scd index ccec46a..7765200 100644 --- a/doc/tofi.1.scd +++ b/doc/tofi.1.scd @@ -38,10 +38,10 @@ All config file options described in *tofi*(5) are also accepted, in the form # KEYS - | | -k | -p | -k | -p + | | -k | -p | -k | -p | -h Move the selection back one entry. - | | -j | -n | -j | -n | + | | -j | -n | -j | -n | -l | Move the selection forward one entry. diff --git a/src/input.c b/src/input.c index 7d9eb54..429b1d1 100644 --- a/src/input.c +++ b/src/input.c @@ -66,11 +66,13 @@ void input_handle_keypress(struct tofi *tofi, xkb_keycode_t keycode) } else if (sym == XKB_KEY_Up || sym == XKB_KEY_Left || sym == XKB_KEY_ISO_Left_Tab + || (key == KEY_H && alt) || ((key == KEY_K || key == KEY_P) && (ctrl || alt))) { select_previous_result(tofi); } else if (sym == XKB_KEY_Down || sym == XKB_KEY_Right || sym == XKB_KEY_Tab + || (key == KEY_L && alt) || ((key == KEY_J || key == KEY_N) && (ctrl || alt))) { select_next_result(tofi); } else if (sym == XKB_KEY_Home) { -- cgit v1.2.3