summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/tofi.1.md6
-rw-r--r--doc/tofi.1.scd6
-rw-r--r--src/main.c18
3 files changed, 22 insertions, 8 deletions
diff --git a/doc/tofi.1.md b/doc/tofi.1.md
index ce3289f..6d2d83f 100644
--- a/doc/tofi.1.md
+++ b/doc/tofi.1.md
@@ -50,13 +50,13 @@ the form **--key=value**.
# KEYS
-\<Up\> \| \<Left\>
+\<Up\> \| \<Left\> \| \<Ctrl\>-k
> Move the selection back one entry.
-\<Down\> \| \<Right\> \| \<Tab\>
+\<Down\> \| \<Right\> \| \<Ctrl\>-j \| \<Tab\>
-> Move the selection back forward entry.
+> Move the selection forward one entry.
\<Enter\>
diff --git a/doc/tofi.1.scd b/doc/tofi.1.scd
index 87740c1..0e48639 100644
--- a/doc/tofi.1.scd
+++ b/doc/tofi.1.scd
@@ -45,11 +45,11 @@ All config file options described in *tofi*(5) are also accepted, in the form
# KEYS
-<Up> | <Left>
+<Up> | <Left> | <Ctrl>-k
Move the selection back one entry.
-<Down> | <Right> | <Tab>
- Move the selection back forward entry.
+<Down> | <Right> | <Ctrl>-j | <Tab>
+ Move the selection forward one entry.
<Enter>
Confirm the current selection and quit.
diff --git a/src/main.c b/src/main.c
index 12e89a2..8f974f0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -205,12 +205,26 @@ static void wl_keyboard_key(
return;
}
- if (sym == XKB_KEY_Up || sym == XKB_KEY_Left) {
+ if (sym == XKB_KEY_Up || sym == XKB_KEY_Left
+ || (sym == XKB_KEY_k
+ && xkb_state_mod_name_is_active(
+ tofi->xkb_state,
+ XKB_MOD_NAME_CTRL,
+ XKB_STATE_MODS_EFFECTIVE)
+ )
+ ) {
uint32_t nsel = MAX(MIN(tofi->window.entry.num_results, tofi->window.entry.results.count), 1);
tofi->window.entry.selection += nsel;
tofi->window.entry.selection--;
tofi->window.entry.selection %= nsel;
- } else if (sym == XKB_KEY_Down || sym == XKB_KEY_Right || sym == XKB_KEY_Tab) {
+ } else if (sym == XKB_KEY_Down || sym == XKB_KEY_Right || sym == XKB_KEY_Tab
+ || (sym == XKB_KEY_j
+ && xkb_state_mod_name_is_active(
+ tofi->xkb_state,
+ XKB_MOD_NAME_CTRL,
+ XKB_STATE_MODS_EFFECTIVE)
+ )
+ ) {
uint32_t nsel = MAX(MIN(tofi->window.entry.num_results, tofi->window.entry.results.count), 1);
tofi->window.entry.selection++;
tofi->window.entry.selection %= nsel;