MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _mpl_modifiers

Method _mpl_modifiers

lib/matplotlib/backends/_backend_tk.py:422–445  ·  view source on GitHub ↗
(event, *, exclude=None)

Source from the content-addressed store, hash-verified

420
421 @staticmethod
422 def _mpl_modifiers(event, *, exclude=None):
423 # Add modifier keys to the key string. Bit values are inferred from
424 # the implementation of tkinter.Event.__repr__ (1, 2, 4, 8, ... =
425 # Shift, Lock, Control, Mod1, ..., Mod5, Button1, ..., Button5)
426 # In general, the modifier key is excluded from the modifier flag,
427 # however this is not the case on "darwin", so double check that
428 # we aren't adding repeat modifier flags to a modifier key.
429 modifiers = [
430 ("ctrl", 1 << 2, "control"),
431 ("alt", 1 << 17, "alt"),
432 ("shift", 1 << 0, "shift"),
433 ] if sys.platform == "win32" else [
434 ("ctrl", 1 << 2, "control"),
435 ("alt", 1 << 4, "alt"),
436 ("shift", 1 << 0, "shift"),
437 ("cmd", 1 << 3, "cmd"),
438 ] if sys.platform == "darwin" else [
439 ("ctrl", 1 << 2, "control"),
440 ("alt", 1 << 3, "alt"),
441 ("shift", 1 << 0, "shift"),
442 ("super", 1 << 6, "super"),
443 ]
444 return [name for name, mask, key in modifiers
445 if event.state & mask and exclude != key]
446
447 def _get_key(self, event):
448 unikey = event.char

Callers 8

motion_notify_eventMethod · 0.95
enter_notify_eventMethod · 0.95
leave_notify_eventMethod · 0.95
button_press_eventMethod · 0.95
button_release_eventMethod · 0.95
scroll_eventMethod · 0.95
scroll_event_windowsMethod · 0.95
_get_keyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected