10000 Update blocking_input.py by saksmito · Pull Request #11661 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Update blocking_input.py #11661

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def mouse_event(self):
self.mouse_event_pop(event)
elif button == self.button_stop:
self.mouse_event_stop(event)
else:
elif self.button_add:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be elif button == self.button_add:?

Or am I overlooking something and there is actually an asymmetry that there are other buttons that should be implicitly be handled as add event if button_add is defined?

self.mouse_event_add(event)

def key_event(self):
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2139,10 +2139,13 @@ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1,
If True, show a red cross at the location of each click.
mouse_add : int, one of (1, 2, 3), optional, default: 1 (left click)
Mouse button used to add points.
Use a different button value to disable this mouse action.
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should use None to disable an action.

mouse_pop : int, one of (1, 2, 3), optional, default: 3 (right click)
Mouse button used to remove the most recently added point.
Use a different button value to disable this mouse action.
mouse_stop : int, one of (1, 2, 3), optional, default: 2 (middle click)
Mouse button used to stop input.
Use a different button value to disable this mouse action.

Returns
-------
Expand Down
0