(modifiers=None, *, exclude=None)
| 423 | |
| 424 | @staticmethod |
| 425 | def _mpl_modifiers(modifiers=None, *, exclude=None): |
| 426 | if modifiers is None: |
| 427 | modifiers = QtWidgets.QApplication.instance().keyboardModifiers() |
| 428 | modifiers = _to_int(modifiers) |
| 429 | # get names of the pressed modifier keys |
| 430 | # 'control' is named 'control' when a standalone key, but 'ctrl' when a |
| 431 | # modifier |
| 432 | # bit twiddling to pick out modifier keys from modifiers bitmask, |
| 433 | # if exclude is a MODIFIER, it should not be duplicated in mods |
| 434 | return [SPECIAL_KEYS[key].replace('control', 'ctrl') |
| 435 | for mask, key in _MODIFIER_KEYS |
| 436 | if exclude != key and modifiers & mask] |
| 437 | |
| 438 | def _get_key(self, event): |
| 439 | event_key = event.key() |
no test coverage detected