| 150 | } |
| 151 | |
| 152 | List<Ref<InputEvent>>::Element *InputMap::_find_event(Action &p_action, const Ref<InputEvent> &p_event, bool p_exact_match, bool *r_pressed, float *r_strength, float *r_raw_strength, int *r_event_index) const { |
| 153 | ERR_FAIL_COND_V(p_event.is_null(), nullptr); |
| 154 | |
| 155 | int i = 0; |
| 156 | for (List<Ref<InputEvent>>::Element *E = p_action.inputs.front(); E; E = E->next()) { |
| 157 | int device = E->get()->get_device(); |
| 158 | if (device == ALL_DEVICES || device == p_event->get_device()) { |
| 159 | if (E->get()->action_match(p_event, p_exact_match, p_action.deadzone, r_pressed, r_strength, r_raw_strength)) { |
| 160 | if (r_event_index) { |
| 161 | *r_event_index = i; |
| 162 | } |
| 163 | return E; |
| 164 | } |
| 165 | } |
| 166 | i++; |
| 167 | } |
| 168 | |
| 169 | return nullptr; |
| 170 | } |
| 171 | |
| 172 | bool InputMap::has_action(const StringName &p_action) const { |
| 173 | return input_map.has(p_action); |
nothing calls this directly
no test coverage detected