From 0fa32c3c167d6fa7047811b824c7afef5b469495 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 6 Mar 2017 16:48:59 +0100 Subject: [PATCH] Step by 10 layers with shift key down --- plugins/LayerView/LayerView.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 390c2dcc7d..56c02a3a26 100755 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -285,13 +285,15 @@ class LayerView(View): def event(self, event): modifiers = QApplication.keyboardModifiers() - ctrl_is_active = modifiers == Qt.ControlModifier + ctrl_is_active = modifiers & Qt.ControlModifier + shift_is_active = modifiers & Qt.ShiftModifier if event.type == Event.KeyPressEvent and ctrl_is_active: + amount = 10 if shift_is_active else 1 if event.key == KeyEvent.UpKey: - self.setLayer(self._current_layer_num + 1) + self.setLayer(self._current_layer_num + amount) return True if event.key == KeyEvent.DownKey: - self.setLayer(self._current_layer_num - 1) + self.setLayer(self._current_layer_num - amount) return True if event.type == Event.ViewActivateEvent: