Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.