From 81560bbdc60cd8155a5a084f6dadfb769e6a637c Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sun, 26 Feb 2023 14:51:27 +0000 Subject: Support Ctrl-n & Ctrl-p navigation. --- doc/tofi.1.md | 4 ++-- doc/tofi.1.scd | 4 ++-- src/input.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/tofi.1.md b/doc/tofi.1.md index 9ef52c6..5d7aaf8 100644 --- a/doc/tofi.1.md +++ b/doc/tofi.1.md @@ -40,11 +40,11 @@ the form **--key=value**. # KEYS -\ \| \ \| \-k +\ \| \ \| \-k \| \-p > Move the selection back one entry. -\ \| \ \| \-j \| \ +\ \| \ \| \-j \| \-n \| \ > Move the selection forward one entry. diff --git a/doc/tofi.1.scd b/doc/tofi.1.scd index 9f7ebe6..35661a1 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 + | | -k | -p Move the selection back one entry. - | | -j | + | | -j | -n | Move the selection forward one entry. diff --git a/src/input.c b/src/input.c index 7f78c50..0ccdead 100644 --- a/src/input.c +++ b/src/input.c @@ -71,7 +71,7 @@ void input_handle_keypress(struct tofi *tofi, xkb_keycode_t keycode) } else if (sym == XKB_KEY_Right) { next_cursor_or_result(tofi); } else if (sym == XKB_KEY_Up || sym == XKB_KEY_Left || sym == XKB_KEY_ISO_Left_Tab - || (key == KEY_K + || ((key == KEY_K || key == KEY_P) && xkb_state_mod_name_is_active( tofi->xkb_state, XKB_MOD_NAME_CTRL, @@ -80,7 +80,7 @@ void input_handle_keypress(struct tofi *tofi, xkb_keycode_t keycode) ) { select_previous_result(tofi); } else if (sym == XKB_KEY_Down || sym == XKB_KEY_Right || sym == XKB_KEY_Tab - || (key == KEY_J + || ((key == KEY_J || key == KEY_N) && xkb_state_mod_name_is_active( tofi->xkb_state, XKB_MOD_NAME_CTRL, -- cgit v1.2.3