diff options
Diffstat (limited to 'main/input_default.cpp')
-rw-r--r-- | main/input_default.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index ea4e3f9505..0561f2bb34 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -381,15 +381,12 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { if (!p_event.is_echo()) { for (const Map<StringName,InputMap::Action>::Element *E=InputMap::get_singleton()->get_action_map().front();E;E=E->next()) { - if (InputMap::get_singleton()->event_is_action(p_event,E->key())) { - - if(is_action_pressed(E->key()) != p_event.is_pressed()) { - Action action; - action.fixed_frame=Engine::get_singleton()->get_fixed_frames(); - action.idle_frame=Engine::get_singleton()->get_idle_frames(); - action.pressed=p_event.is_pressed(); - action_state[E->key()]=action; - } + if (InputMap::get_singleton()->event_is_action(p_event,E->key()) && is_action_pressed(E->key()) != p_event.is_pressed()) { + Action action; + action.fixed_frame=Engine::get_singleton()->get_fixed_frames(); + action.idle_frame=Engine::get_singleton()->get_idle_frames(); + action.pressed=p_event.is_pressed(); + action_state[E->key()]=action; } } } @@ -486,7 +483,7 @@ Point2 InputDefault::get_last_mouse_speed() const { int InputDefault::get_mouse_button_mask() const { - return OS::get_singleton()->get_mouse_button_state(); + return mouse_button_mask;// do not trust OS implementaiton, should remove it - OS::get_singleton()->get_mouse_button_state(); } void InputDefault::warp_mouse_pos(const Vector2& p_to) { |