diff options
| author | Eric M <itsjusteza@gmail.com> | 2020-12-07 21:31:51 +1000 |
|---|---|---|
| committer | Eric M <itsjusteza@gmail.com> | 2021-02-18 16:22:50 +0100 |
| commit | 074f53563d6955dfddaf7d7b4b787664af2c29a7 (patch) | |
| tree | 89528e45a67f4d8949a51c175ffc6fd6b8f4035a /core/input/input.cpp | |
| parent | ca1abc7352ed3d8e9ca82eb4838777270f7c27a9 (diff) | |
| download | redot-engine-074f53563d6955dfddaf7d7b4b787664af2c29a7.tar.gz | |
Added ability to override built-in actions for the editor
This adds the ability to add overrides for built-in actions (i.e. ui_*) in the editor. Also added a number of additional built-in actions for various text-related actions, gui-generic actions (like copy and paste) and graph-related actions (duplicate nodes), etc. Moved the definition of input actions to input_map, rather than in project_settings so the editor can make use of these actions as well.
Diffstat (limited to 'core/input/input.cpp')
| -rw-r--r-- | core/input/input.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 48e573626d..90d96e3876 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -604,21 +604,21 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em } } - 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())) { + for (OrderedHashMap<StringName, InputMap::Action>::ConstElement E = InputMap::get_singleton()->get_action_map().front(); E; E = E.next()) { + if (InputMap::get_singleton()->event_is_action(p_event, E.key())) { // If not echo and action pressed state has changed - if (!p_event->is_echo() && is_action_pressed(E->key(), false) != p_event->is_action_pressed(E->key())) { + if (!p_event->is_echo() && is_action_pressed(E.key(), false) != p_event->is_action_pressed(E.key())) { Action action; action.physics_frame = Engine::get_singleton()->get_physics_frames(); action.process_frame = Engine::get_singleton()->get_process_frames(); - action.pressed = p_event->is_action_pressed(E->key()); + action.pressed = p_event->is_action_pressed(E.key()); action.strength = 0.0f; action.raw_strength = 0.0f; - action.exact = InputMap::get_singleton()->event_is_action(p_event, E->key(), true); - action_state[E->key()] = action; + action.exact = InputMap::get_singleton()->event_is_action(p_event, E.key(), true); + action_state[E.key()] = action; } - action_state[E->key()].strength = p_event->get_action_strength(E->key()); - action_state[E->key()].raw_strength = p_event->get_action_raw_strength(E->key()); + action_state[E.key()].strength = p_event->get_action_strength(E.key()); + action_state[E.key()].raw_strength = p_event->get_action_raw_strength(E.key()); } } |
