Handles a single key press (mouse and keyboard).
(self, key, action, modifiers)
| 273 | self._z_axis_callback.append(callback) |
| 274 | |
| 275 | def _handle_key(self, key, action, modifiers): |
| 276 | """Handles a single key press (mouse and keyboard).""" |
| 277 | alias_key = (key, modifiers) |
| 278 | |
| 279 | exclusive_key, exclusive_callback = self._active_exclusive |
| 280 | if exclusive_key is not None: |
| 281 | if action == RELEASE and key == exclusive_key: |
| 282 | exclusive_callback(False) |
| 283 | self._active_exclusive = _NO_EXCLUSIVE_KEY |
| 284 | else: |
| 285 | is_exclusive, callback = self._action_callbacks.get( |
| 286 | alias_key, _NO_CALLBACK) |
| 287 | if callback: |
| 288 | if action == PRESS: |
| 289 | if is_exclusive: |
| 290 | callback(True) |
| 291 | self._active_exclusive = (key, callback) |
| 292 | else: |
| 293 | callback() |
| 294 | |
| 295 | def _handle_double_click(self, key, modifiers): |
| 296 | """Handles a double mouse click.""" |