summaryrefslogtreecommitdiffstats
path: root/editor/plugins/spatial_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 2af64b6ed6..c72b4f1bb1 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -30,7 +30,7 @@
#include "spatial_editor_plugin.h"
-#include "core/input/input.h"
+#include "core/input/input_filter.h"
#include "core/math/camera_matrix.h"
#include "core/os/keyboard.h"
#include "core/print_string.h"
@@ -298,10 +298,10 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) {
float zoom_inertia = EDITOR_GET("editors/3d/navigation_feel/zoom_inertia");
//determine if being manipulated
- bool manipulated = Input::get_singleton()->get_mouse_button_mask() & (2 | 4);
- manipulated |= Input::get_singleton()->is_key_pressed(KEY_SHIFT);
- manipulated |= Input::get_singleton()->is_key_pressed(KEY_ALT);
- manipulated |= Input::get_singleton()->is_key_pressed(KEY_CONTROL);
+ bool manipulated = InputFilter::get_singleton()->get_mouse_button_mask() & (2 | 4);
+ manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT);
+ manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_ALT);
+ manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL);
float orbit_inertia = MAX(0.00001, manipulated ? manip_orbit_inertia : free_orbit_inertia);
float translation_inertia = MAX(0.0001, manipulated ? manip_translation_inertia : free_translation_inertia);
@@ -2260,7 +2260,7 @@ void SpatialEditorViewport::scale_freelook_speed(real_t scale) {
Point2i SpatialEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
Point2i relative;
if (bool(EDITOR_DEF("editors/3d/navigation/warped_mouse_panning", false))) {
- relative = Input::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
+ relative = InputFilter::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
} else {
relative = p_ev_mouse_motion->get_relative();
}
@@ -2276,7 +2276,7 @@ static bool is_shortcut_pressed(const String &p_path) {
if (k == NULL) {
return false;
}
- const Input &input = *Input::get_singleton();
+ const InputFilter &input = *InputFilter::get_singleton();
int keycode = k->get_keycode();
return input.is_key_pressed(keycode);
}
@@ -3771,7 +3771,7 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p
if (!can_drop_data_fw(p_point, p_data, p_from))
return;
- bool is_shift = Input::get_singleton()->is_key_pressed(KEY_SHIFT);
+ bool is_shift = InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT);
selected_files.clear();
Dictionary d = p_data;
@@ -5721,7 +5721,7 @@ void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack())
return;
- snap_key_enabled = Input::get_singleton()->is_key_pressed(KEY_CONTROL);
+ snap_key_enabled = InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL);
}
void SpatialEditor::_notification(int p_what) {
@@ -6381,7 +6381,7 @@ Vector3 SpatialEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
float SpatialEditor::get_translate_snap() const {
float snap_value;
- if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+ if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_translate->get_text().to_double() / 10.0;
} else {
snap_value = snap_translate->get_text().to_double();
@@ -6392,7 +6392,7 @@ float SpatialEditor::get_translate_snap() const {
float SpatialEditor::get_rotate_snap() const {
float snap_value;
- if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+ if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_rotate->get_text().to_double() / 3.0;
} else {
snap_value = snap_rotate->get_text().to_double();
@@ -6403,7 +6403,7 @@ float SpatialEditor::get_rotate_snap() const {
float SpatialEditor::get_scale_snap() const {
float snap_value;
- if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+ if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_scale->get_text().to_double() / 2.0;
} else {
snap_value = snap_scale->get_text().to_double();