MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _find_event

Method _find_event

core/input/input_map.cpp:152–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152List<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
172bool InputMap::has_action(const StringName &p_action) const {
173 return input_map.has(p_action);

Callers

nothing calls this directly

Calls 6

action_matchMethod · 0.80
is_nullMethod · 0.45
frontMethod · 0.45
nextMethod · 0.45
get_deviceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected