diff options
author | Nuno <n.donato@estrelasustentavel.pt> | 2016-02-07 18:48:13 +0000 |
---|---|---|
committer | Nuno Donato <nunodonato@gmail.com> | 2016-02-12 11:51:25 +0000 |
commit | 67a839c79110221c3350392317fafa66a1b0c5f4 (patch) | |
tree | 1683f0e2820a0e1a01e92d296a7c0a480c38034f /tools | |
parent | de6d6633ec96ee90afb3074be79c0ad6055ec8eb (diff) |
* Added numpad emulation (fixes #3612)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 20 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 4195ba97e6..e8b40bdcf3 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -490,6 +490,7 @@ void EditorSettings::_load_defaults() { hints["3d_editor/pan_modifier"]=PropertyInfo(Variant::INT,"3d_editor/pan_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); set("3d_editor/zoom_modifier",4); hints["3d_editor/zoom_modifier"]=PropertyInfo(Variant::INT,"3d_editor/zoom_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); + set("3d_editor/emulate_numpad",false); set("2d_editor/bone_width",5); set("2d_editor/bone_color1",Color(1.0,1.0,1.0,0.9)); 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); |