fltrdr icon indicating copy to clipboard operation
fltrdr copied to clipboard

Cannot rebind keys

Open DKuykendall opened this issue 6 years ago • 2 comments

Keys currently cannot be rebound. HJKL is awkward for some non-standard/non-us keyboard layouts.

As fltrdr already exposes most if not all of the necessary commands to fit the functionality of the existing keybinds, I'd suggest a format in the config something like:

bind {key} {command} {args}

DKuykendall avatar Feb 21 '19 02:02 DKuykendall

I don't think this would be top priority, so you can use the arrow keys to navigate or you can just edit src/fltrdr/tui.cc to suit your preference and compile.

gh0stl4b avatar Feb 22 '19 08:02 gh0stl4b

I think this would be a great addition, thanks for bringing this up.

There are a few things that need to be implemented beforehand.

  • The command function that parses the commands should be refactored into some kind of data structure for more efficient lookup.
  • The input loop that parses what key was pressed and calls the corresponding functions should be put in a hash map where the key is the character pressed, and the value is perhaps an enum that could be used to look up the function call from an array.

I think after the above is done, making an interface to assign a specific key to a certain function would be possible.

octobanana avatar Feb 26 '19 00:02 octobanana