This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In addition to the `Event` attributes, the following event
attributes are defined:
A ResizeEvent has a number of special attributes in addition to those
defined by the parent `Event` class.
Attributes
----------
Expand All
@@ -1284,32 +1285,23 @@ class LocationEvent(Event):
"""
An event that has a screen location.
The following additional attributes are defined and shown with
their default values.
In addition to the `Event` attributes, the following
event attributes are defined:
A LocationEvent has a number of special attributes in addition to those
defined by the parent `Event` class.
Attributes
----------
x : int
x position - pixels from left of canvas.
y : int
y position - pixels from bottom of canvas.
x, y : int or None
Event location in pixels from bottom left of canvas.
inaxes : `~.axes.Axes` or None
The `~.axes.Axes` instance over which the mouse is, if any.
xdata : float or None
x data coordinate of the mouse.
ydata : float or None
y data coordinate of the mouse.
xdata, ydata : float or None
Data coordinates of the mouse within *inaxes*, or *None* if the mouse
is not over an Axes.
"""
lastevent = None # the last event that was triggered before this one
def __init__(self, name, canvas, x, y, guiEvent=None):
"""
(*x*, *y*) in figure coords ((0, 0) = bottom left).
"""
super().__init__(name, canvas, guiEvent=guiEvent)
# x position - pixels from left of canvas
self.x = int(x) if x is not None else x
Expand Down
Expand Up
@@ -1378,13 +1370,11 @@ class MouseButton(IntEnum):
class MouseEvent(LocationEvent):
"""
A mouse event ('button_press_event',
'button_release_event',
'scroll_event',
'motion_notify_event').
A mouse event ('button_press_event', 'button_release_event', \
'scroll_event', 'motion_notify_event').
In addition to the `Event` and `LocationEvent`
attributes, the following attributes are defined:
A MouseEvent has a number of special attributes in addition to those
defined by the parent `Event` and `LocationEvent` classes.
Attributes
----------
Expand Down
Expand Up
@@ -1426,10 +1416,6 @@ def on_press(event):
def __init__(self, name, canvas, x, y, button=None, key=None,
step=0, dblclick=False, guiEvent=None):
"""
(*x*, *y*) in figure coords ((0, 0) = bottom left)
button pressed None, 1, 2, 3, 'up', 'down'
"""
if button in MouseButton.__members__.values():
button = MouseButton(button)
self.button = button
Expand All
@@ -1450,11 +1436,14 @@ def __str__(self):
class PickEvent(Event):
"""
A pick event, fired when the user picks a location on the canvas
A pick event.
This event is fired when the user picks a location on the canvas
sufficiently close to an artist that has been made pickable with
`.Artist.set_picker`.
Attrs: all the `Event` attributes plus
A PickEvent has a number of special attributes in addition to those defined
by the parent `Event` class.
Attributes
----------
Expand Down
Expand Up
@@ -1495,19 +1484,16 @@ class KeyEvent(LocationEvent):
"""
A key event (key press, key release).
Attach additional attributes as defined in
:meth:`FigureCanvasBase.mpl_connect`.
In addition to the `Event` and `LocationEvent`
attributes, the following attributes are defined:
A KeyEvent has a number of special attributes in addition to those defined
by the parent `Event` and `LocationEvent` classes.
Attributes
----------
key : None or str
the key(s) pressed. Could be **None**, a single case sensitive ascii
character ("g", "G", "#", etc.), a special key
("control", "shift", "f1", "up", etc.) or a
combination of the above (e.g., "ctrl+alt+g", "ctrl+alt+G").
The key(s) pressed. Could be *None*, a single case sensitive Unicode
character ("g", "G", "#", etc.), a special key ("control", "shift",
"f1", "up", etc.) or a combination of the above (e.g., "ctrl+alt+g",
"ctrl+alt+G").
Notes
-----
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean up some Event class docs. #20745
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
Uh oh!
There was an error while loading. Please reload this page.
Clean up some Event class docs. #20745
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing