1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Add numpad emulation in 3D viewport

(cherry picked from commit 4a26e61e89)
This commit is contained in:
Haoyu Qiu
2021-07-02 15:27:12 +08:00
committed by Rémi Verschelde
parent 3b11b1022d
commit f252622d82
2 changed files with 8 additions and 0 deletions

View File

@@ -1927,6 +1927,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
return;
}
if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_numpad")) {
const uint32_t code = k->get_scancode();
if (code >= KEY_0 && code <= KEY_9) {
k->set_scancode(code - KEY_0 + KEY_KP_0);
}
}
if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
if (_edit.mode != TRANSFORM_NONE) {
_edit.snap = !_edit.snap;