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

Add function to manually control mouse-capture #80

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hasezoey
Copy link
Contributor

@hasezoey hasezoey commented May 5, 2024

Description

This PR adds manual function to enable / disable mouse-capture.
The reason being some TUI applications dont need / want to handle mouse events (and couldnt even without #79).
And some TUI applications may want to disable mouse-capture temporarily to have native text copy again.

Also change to not have MouseCapture enabled by default.

Fixes #64 as this will automatically translate mouse scroll to keyboard scroll again.

Type of change

Please select relevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Note: because TerminalError is not marked non_exhaustive this change could be considered breaking

Checklist

  • My code follows the contribution guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I formatted the code with cargo fmt
  • I checked my code using cargo clippy and reports no warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have introduced no new C-bindings
  • The changes I've made are Windows, MacOS, UNIX, Linux compatible (or I've handled them using cfg target_os)
  • I increased or maintained the code coverage for the project, compared to the previous commit

Note: i am not sure how i should add tests for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant