summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-02-16 07:50:51 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-02-16 07:50:51 +0100
commit7496fd4788a2aced44188f3c113eb15994fda4c0 (patch)
tree213b4e1dfa935bec45f8f751dc303fa0b2b5297a /tools/editor/plugins
parent658153a08807d1461dc7d50157399c252a2e4d1c (diff)
parent67a839c79110221c3350392317fafa66a1b0c5f4 (diff)
Merge pull request #3689 from nunodonato/numpademulation
* Added numpad emulation in the 3d viewport (fixes #3612)
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index cf92473919..bc57fd7e44 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -1631,8 +1631,11 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
_edit.snap=true;
}
} break;
+ case KEY_7:
case KEY_KP_7: {
-
+ bool emulate_numpad = EditorSettings::get_singleton()->get("3d_editor/emulate_numpad");
+ if (!emulate_numpad && k.scancode==KEY_7)
+ return;
cursor.y_rot=0;
if (k.mod.shift) {
cursor.x_rot=-Math_PI/2.0;
@@ -1647,8 +1650,11 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
_update_name();
}
} break;
+ case KEY_1:
case KEY_KP_1: {
-
+ bool emulate_numpad = EditorSettings::get_singleton()->get("3d_editor/emulate_numpad");
+ if (!emulate_numpad && k.scancode==KEY_1)
+ return;
cursor.x_rot=0;
if (k.mod.shift) {
cursor.y_rot=Math_PI;
@@ -1664,8 +1670,11 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
}
} break;
+ case KEY_3:
case KEY_KP_3: {
-
+ bool emulate_numpad = EditorSettings::get_singleton()->get("3d_editor/emulate_numpad");
+ if (!emulate_numpad && k.scancode==KEY_3)
+ return;
cursor.x_rot=0;
if (k.mod.shift) {
cursor.y_rot=Math_PI/2.0;
@@ -1680,8 +1689,11 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
}
} break;
+ case KEY_5:
case KEY_KP_5: {
-
+ bool emulate_numpad = EditorSettings::get_singleton()->get("3d_editor/emulate_numpad");
+ if (!emulate_numpad && k.scancode==KEY_5)
+ return;
//orthogonal = !orthogonal;
_menu_option(orthogonal?VIEW_PERSPECTIVE:VIEW_ORTHOGONAL);