diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-03-19 09:20:20 +0100 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-03-19 09:20:44 +0100 |
commit | a69e449782214c6108303af782c8aa321e5b11ea (patch) | |
tree | aca1d1bd48c26a0198b59246948a562d7315b91d /main | |
parent | 7eb8a67025c04e8a72c219944e14432f38ad5135 (diff) |
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.
Diffstat (limited to 'main')
-rw-r--r-- | main/input_default.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/input_default.h b/main/input_default.h index a1a055366c..fecdb215d7 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -201,7 +201,8 @@ public: virtual void warp_mouse_pos(const Vector2 &p_to); - void parse_input_event(const InputEvent &p_event); + virtual void parse_input_event(const InputEvent &p_event); + void set_gravity(const Vector3 &p_gravity); void set_accelerometer(const Vector3 &p_accel); void set_magnetometer(const Vector3 &p_magnetometer); |