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

Feature: mouse keymaps configuration #9386

Closed
wants to merge 0 commits into from
Closed

Conversation

Nilsia
Copy link

@Nilsia Nilsia commented Jan 19, 2024

Feature: enable configuration for mouse keys

Extended KeyMaps for MouseEvents.
Added a trait for KeyEvent and MouseEvent, so Keymaps depends on generics.

Updated / Added tests for mouses in configuration.

This is a pull request for this issue : #7982

@the-mikedavis the-mikedavis linked an issue Jan 19, 2024 that may be closed by this pull request
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @pascalkuthe that #7982 would be a nice-to-have feature but Helix is keyboard-centric (ref #7982 (comment)). This is a really massive change that we wouldn't be comfortable merging for a low priority issue.

I scanned through the changes though and it looks like the bulk of the changes come from trying to make mouse config and commands roughly equivalent to keyboard config and commands via the trait. The trait is forcing an abstraction that shouldn't exist. You don't need to be able to execute regular commands with the mouse and definitely not execute mouse commands via the keyboard. Instead mouse commands can be separate (for example under a helix-term/src/commands/mouse.rs module) and take additional parameters like the mouse position. The existing commands and keymap structs can be left untouched.

@Nilsia
Copy link
Author

Nilsia commented Jan 20, 2024

Well, I all agree.
I will rework on this, to make these changes:

  • Add a new type of commands that are only made for the mouse (some of them will point out to key commands like goto_line_end or move_next_word_end (using the last one makes easier selecting a word)),
  • differ Keymaps and Mousemaps where Mousemaps will only accept 2-left = "" and not 2-left = { 1-right = "" }
  • the code will maybe be in some ways a bit duplicated, as so I will try to add traits without generics

@kirawi kirawi added C-enhancement Category: Improvements A-helix-term Area: Helix term improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 23, 2024
@Nilsia Nilsia closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map Mouse Buttons in Config
3 participants