summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-14 19:43:10 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-14 19:43:10 +0200
commit5f5d81d2574e38a3469bbcea2420569bf8d8aa5d (patch)
tree517fddcbcfaee4fa2e21603ad0f2c1803570198f
parent450179daab06856f79a7e1159ca68d64e846ab64 (diff)
general: Added initial key-bind support.
-rwxr-xr-xfff28
1 files changed, 24 insertions, 4 deletions
diff --git a/fff b/fff
index 2f00005..f51629d 100755
--- a/fff
+++ b/fff
@@ -444,14 +444,34 @@ cmd_line() {
key_user() {
# Handle user rebound keys.
+ # We set the variable to 'null' if its unset
+ # since the value of '$key' won't be longer
+ # than 1 char. The variables need a default
+ # value since return/enter is a blank string.
- # If user has rebound '-'
- [[ $1 == "${FFF_PREV_DIR_KEY:-null}" ]] &&
- key="-"
+ # If user has rebound 'l'
+ [[ $1 == "${FFF_KEY_L:-null}" ]] &&
+ key="l"
+
+ # If user has rebound 'Right Arrow'
+ [[ $1 == "${FFF_KEY_RIGHT:-null}" ]] &&
+ key="C"
+
+ # If user has rebound 'Right Arrow'
+ [[ $1 == "${FFF_KEY_ENTER:-null}" ]] &&
+ key=""
# If user has rebound 'h'
- [[ $1 == "${FFF_PARENT_DIR_KEY:-null}" ]] &&
+ [[ $1 == "${FFF_KEY_H:-null}" ]] &&
key="h"
+
+ # If user has rebound 'h'
+ [[ $1 == "${FFF_KEY_LEFT:-null}" ]] &&
+ key="D"
+
+ # If user has rebound '-'
+ [[ $1 == "${FFF_KEY_DASH:-null}" ]] &&
+ key="-"
}
key() {