Skip to content

Conversation

@finnvoor
Copy link
Collaborator

@finnvoor finnvoor commented Feb 25, 2025

  • add left/right mouse down/up/drag and mouseMoved events to KeyStrokeListener
  • add withMouseTracking to Terminal to enable mouse tracking / mouse motion tracking
  • add KeyStrokeListenerTests to test characters/special keys/mouse events are decoded properly
  • update the KeyStrokeListener docs describing how to listen for mouse events
  • add mouse-tracking to examples-cli with a demo showcasing mouse tracking (click and drag to draw). I wasn't sure if this should be included as an example since it does not showcase a specific component, but I think it's a good example demoing KeyStrokeListener. Happy to remove though.

A future PR can add mouse support to the existing components (click yes/no, select option from list with mouse)

CleanShot.2025-02-25.at.22.01.33.mp4

Copy link
Contributor

@pepicrft pepicrft left a comment

Choose a reason for hiding this comment

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

@finnvoor would you mind rebasing the latest changes from main to eliminate some noise from the PR?

@pepicrft
Copy link
Contributor

@all-contributors add @finnvoor for code

@allcontributors
Copy link
Contributor

@pepicrft

I've put up a pull request to add @finnvoor! 🎉

Copy link
Member

Choose a reason for hiding this comment

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

You're a CLI wizard! 🪄

Copy link
Contributor

@pepicrft pepicrft left a comment

Choose a reason for hiding this comment

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

You blew my mind with this. @finnvoor what if we rename KeystrokeListener to TerminalEventListener to be more generic? Otherwise listening mouse events from a keystroke listener feels odd.

@finnvoor
Copy link
Collaborator Author

what if we rename KeystrokeListener to TerminalEventListener to be more generic?

I think that would be nice, in the future it could also send other event types e.g. terminal resize signal

@finnvoor
Copy link
Collaborator Author

#210

@finnvoor finnvoor closed this Feb 27, 2025
@finnvoor finnvoor deleted the feature/mouse-tracking branch February 27, 2025 21:37
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.

3 participants