summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-05 14:18:36 +0200
committerGitHub <noreply@github.com>2021-07-05 14:18:36 +0200
commit3fbfb24773eda3a2ec12f70182fbf46ec925f05f (patch)
tree7619006102fbe51da28de46b906530143ad5fc85 /editor/plugins
parentf2d8bad2d17fd89e43b6a5fe7816a28645016cb4 (diff)
parent4a26e61e89807c0f452f7cb4b6bde590ef39c891 (diff)
Merge pull request #50070 from timothyqiu/emu-numpad
Add numpad emulation in 3D viewport
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 78390f0fdf..98a36307b8 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1967,6 +1967,13 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
return;
}
+ if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_numpad")) {
+ const uint32_t code = k->get_keycode();
+ if (code >= KEY_0 && code <= KEY_9) {
+ k->set_keycode(code - KEY_0 + KEY_KP_0);
+ }
+ }
+
if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
if (_edit.mode != TRANSFORM_NONE) {
_edit.snap = !_edit.snap;