Bind Ctrl+MouseWheel to scroll up/down #1051
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On my system, Shift+Mouse is captured by the terminal and
Alt+Mouse only works for one of the alt keys. Also,
lf
currentlytends to support Ctrl bindings but not Alt. Hence I picked
Ctrl.
This also allows binding of Ctrl+MouseButtons (but doesn't set
any such bindings).
As a minor bonus, that should allow using Ctrl+Click to
select
lf
's terminal without moving the cursor no matterwhere you click. On tmux, this doesn't work out of the box and
requires a change to
tmux.conf
along the following lines:You can omit the
send-keys -M
if you never want to passCtrl+Click
to any of your terminal apps. (Then it will work without this PR).
This builds on top of @p-ouellette's work.
I also have subsequent commits that allow binding other modifier keys with the mouse and in keyboard bindings (e.g. Ctrl+Enter vs Alt+Enter). See various commits in https://github.com/ilyagr/lf/tree/a-enter (not all of them are polished to be easier to review). I'm not submitting that now since it might be more controversial, but let me know if you are interested.