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

Support shift key reading for sgrmouse #859

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

penguinolog
Copy link
Collaborator

Note:

shift accessibility depends on terminal
(terminal may intercept "shift mouse press" for keys 1-3)

Fix: #857

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

Validated on the input_test.py

Note:

  shift accessibility depends on terminal
  (terminal may intercept "shift mouse press" for keys 1-3)

Fix: urwid#857
# implemented by using a timer. This timer can check if the last
# registered click is below a certain threshold. This threshold
# is normally set in the operating system itself, so setting one
# here will cause an inconsistent behaviour. I do not plan to use
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let's remove "I do not plan": somebody can try to implement this really complex feature

@@ -310,17 +310,15 @@ def read_sgrmouse_info(self, keys: Collection[int], more_available: bool):

(b, x, y) = (int(val) for val in value[:-1].split(";"))
action = value[-1]

# shift, etc. is not communicated on my machine, so I
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

other keys was added before, shift was the last one.
Unfortunately, on the most terminal emulators it's not intercepted only with scroll wheel, but now we have the first user and his use case was testable.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8262923968

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 74.413%

Changes Missing Coverage Covered Lines Changed/Added Lines %
urwid/display/escape.py 1 2 50.0%
Totals Coverage Status
Change from base Build 8229566376: -0.001%
Covered Lines: 9291
Relevant Lines: 12627

💛 - Coveralls

@penguinolog penguinolog merged commit dc2d032 into urwid:master Mar 13, 2024
35 checks passed
@penguinolog penguinolog deleted the sgrmouse_shift_handle branch March 13, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Not receiving 'shift mouse press' events
2 participants