Skip to content

Support shift key reading for sgrmouse - #859

Merged
penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:sgrmouse_shift_handle
Mar 13, 2024
Merged

penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:sgrmouse_shift_handle

Conversation

@penguinolog

Copy link
Copy Markdown
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
Comment thread urwid/display/escape.py
# 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
Copy Markdown
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

Comment thread urwid/display/escape.py
(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
Copy Markdown
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
Copy Markdown

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
@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