Skip to content

Comments

Improve support for mouse events handling#2605

Merged
dmaluka merged 1 commit intomicro-editor:masterfrom
dmaluka:luamouse-v2
Mar 14, 2024
Merged

Improve support for mouse events handling#2605
dmaluka merged 1 commit intomicro-editor:masterfrom
dmaluka:luamouse-v2

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