summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-14 19:27:17 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-14 19:27:17 +0200
commit450179daab06856f79a7e1159ca68d64e846ab64 (patch)
tree495cac24fe4dd173b7ab269c15fb5c9baf7ee23a
parent2d597ce0e4f9b84cbbceb41d11d3225b5227f414 (diff)
general: Added initial key-bind support.
-rwxr-xr-xfff12
1 files changed, 10 insertions, 2 deletions
diff --git a/fff b/fff
index a5cd8d2..2f00005 100755
--- a/fff
+++ b/fff
@@ -442,8 +442,8 @@ cmd_line() {
printf '\e[2K\e[?6h\e[?25l\e8'
}
-key() {
- local key="$1"
+key_user() {
+ # Handle user rebound keys.
# If user has rebound '-'
[[ $1 == "${FFF_PREV_DIR_KEY:-null}" ]] &&
@@ -452,6 +452,14 @@ key() {
# If user has rebound 'h'
[[ $1 == "${FFF_PARENT_DIR_KEY:-null}" ]] &&
key="h"
+}
+
+key() {
+ # Handle user key-presses.
+ local key="$1"
+
+ # Handle user rebound keys.
+ key_user "$key"
case "$key" in
# Open list item.