Input: bind parse_input_event()

When using get_tree().input_event(ev), the engine will JUST send the event down the SceneTree.
However, you won't get any of the benefits of the Input singleton:
- No InputMap actions will be emitted
- The internal input state won't be modified, so methods like `Input.get_mouse_pos()` or `Input.is_joy_button_pressed` won't return the expected output after sending the event.

This is fixed by using `Input.parse_input_event(ev)` instead.
I guess we'll also have to update the docs to reflect that this is the preferred method of sending custom InputEvents.
This commit is contained in:
Andreas Haas
2017-03-19 09:20:20 +01:00
parent 7eb8a67025
commit a69e449782
3 changed files with 5 additions and 1 deletions

View File

@ -102,6 +102,8 @@ public:
virtual int get_joy_button_index_from_string(String p_button) = 0;
virtual int get_joy_axis_index_from_string(String p_axis) = 0;
virtual void parse_input_event(const InputEvent &p_event) = 0;
Input();
};