Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.cpp (C++)

Code before:

			} break;

			case NAVIGATION_LOOK: {
				_nav_look(pan_gesture, pan_gesture->get_delta());

			} break;

			default: {
			}
		}
	}

	Ref<InputEventKey> k = p_event;

	if (k.is_valid()) {
		if (!k->is_pressed()) {
			return;
		}

		if (EDITOR_GET("editors/3d/navigation/emulate_numpad")) {
			const Key code = k->get_physical_keycode();
			if (code >= Key::KEY_0 && code <= Key::KEY_9) {
				k->set_keycode(code - Key::KEY_0 + Key::KP_0);
			}
		}

		if (_edit.mode == TRANSFORM_NONE) {
			if (_edit.gizmo.is_valid() && (k->get_keycode() == Key::ESCAPE || k->get_keycode() == Key::BACKSPACE)) {
				// Restore.
				_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
				_edit.gizmo = Ref<EditorNode3DGizmo>();
			}
			if (k->get_keycode() == Key::ESCAPE && !cursor.region_select) {
				_clear_selected();
				return;
			}
		} else {
			// We're actively transforming, handle keys specially
			TransformPlane new_plane = TRANSFORM_VIEW;
			String new_message;
			if (ED_IS_SHORTCUT("spatial_editor/lock_transform_x", p_event)) {
				new_plane = TRANSFORM_X_AXIS;
				new_message = TTR("X-Axis Transform.");
			} else if (ED_IS_SHORTCUT("spatial_editor/lock_transform_y", p_event)) {
				new_plane = TRANSFORM_Y_AXIS;
				new_message = TTR("Y-Axis Transform.");
			} else if (ED_IS_SHORTCUT("spatial_editor/lock_transform_z", p_event)) {
				new_plane = TRANSFORM_Z_AXIS;
				new_message = TTR("Z-Axis Transform.");
			} else if (_edit.mode != TRANSFORM_ROTATE) { // rotating on a plane doesn't make sense

Review comment (suggestion):
```suggestion
			// In a Blender-style transform, numbers set the magnitude of the transform.
			// E.g. pressing g4.5x means "translate 4.5 units along the X axis".
			// Use the Unicode value because we care about the text, not the actual keycode.
			// This ensures numbers work consistently across different keyboard language layouts.
```

Code after:
				_nav_orbit(pan_gesture, -pan_gesture->get_delta());

			} break;

			case NAVIGATION_LOOK: {
				_nav_look(pan_gesture, pan_gesture->get_delta());

			} break;

			default: {
			}
		}
	}

	Ref<InputEventKey> k = p_event;

	if (k.is_valid()) {
		if (!k->is_pressed()) {
			return;
		}

		if (_edit.instant) {
			// In a Blender-style transform, numbers set the magnitude of the transform.
			// E.g. pressing g4.5x means "translate 4.5 units along the X axis".
			// Use the Unicode value because we care about the text, not the actual keycode.
			// This ensures numbers work consistently across different keyboard language layouts.
			bool processed = true;
			Key key = k->get_physical_keycode();
			char32_t unicode = k->get_unicode();
			if (unicode >= '0' && unicode <= '9') {
				uint32_t value = uint32_t(unicode - Key::KEY_0);
				if (_edit.numeric_next_decimal < 0) {
					_edit.numeric_input = _edit.numeric_input + value * Math::pow(10.0, _edit.numeric_next_decimal--);
				} else {
					_edit.numeric_input = _edit.numeric_input * 10 + value;
				}
				update_transform_numeric();
			} else if (unicode == '-') {
				_edit.numeric_negate = !_edit.numeric_negate;
				update_transform_numeric();
			} else if (unicode == '.') {
				if (_edit.numeric_next_decimal == 0) {
					_edit.numeric_next_decimal = -1;
				}
			} else if (key == Key::ENTER || key == Key::KP_ENTER || key == Key::SPACE) {
				commit_transform();
			} else {
				processed = false;
			}

			if (processed) {