Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind Ctrl+MouseWheel to scroll up/down #1051

Merged
merged 1 commit into from
Feb 11, 2023
Merged

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Dec 22, 2022

On my system, Shift+Mouse is captured by the terminal and
Alt+Mouse only works for one of the alt keys. Also, lf currently
tends 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 matter
where you click. On tmux, this doesn't work out of the box and
requires a change to tmux.conf along the following lines:

 bind-key -T root  C-MouseDown1Pane  select-pane -t = \; send-keys -M

You can omit the send-keys -M if you never want to pass Ctrl+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.

@ilyagr ilyagr changed the title Bind Ctrl+Mouse to scroll up/down Bind Ctrl+MouseWheel to scroll up/down Dec 22, 2022
@ilyagr ilyagr force-pushed the ctrl-up branch 3 times, most recently from fa6d532 to a44a53d Compare December 22, 2022 22:04
On my system, Shift+Mouse is captured by the terminal and
Alt+Mouse only works for one of the alt keys. 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 matter where you
click.  On tmux, this doesn't work out of the box and requires
a change to `tmux.conf` along the following lines:

     bind-key -T root  C-MouseDown1Pane  select-pane -t = \; send-keys -M

You can omit the `send-keys -M` if you never want to pass
`Ctrl+Click` to any of your terminal apps. (Then it will work
without this PR).
@gokcehan gokcehan merged commit 2fe5e4d into gokcehan:master Feb 11, 2023
@ilyagr ilyagr deleted the ctrl-up branch February 12, 2023 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants