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

Improve support for mouse events handling #2605

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Oct 25, 2022

  • If a mouse event is bound to a Lua function, pass *tcell.EventMouse to this Lua function, so that it can find out the position where a button was clicked etc, just like the built-in MousePress and MouseMultiCursor actions.

  • Make mouse actions more a first-class citizen: allow chaining them and running onAction and preAction callbacks for them, just like key actions.

Fixes #1791 (together with PR #2606)

Examples of using this PR are in my search and nav plugins:
https://github.com/dmaluka/micro-search
https://github.com/dmaluka/micro-nav

- If a mouse event is bound to a Lua function, pass *tcell.EventMouse to
  this Lua function, so that it can find out the position where a button
  was clicked etc, just like the built-in MousePress and MouseMultiCursor
  actions.

- Make mouse actions more a first-class citizen: allow chaining them and
  running onAction and preAction callbacks for them, just like key actions.
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.

Better support for handling mouse events in Lua
1 participant