bevy/crates/bevy_input/src
Félix Lescaudey de Maneville c4fc5d88f0 Fixed bevy_ui touch input (#4099)
# Objective

`bevy_ui` doesn't support correctly touch inputs because of two problems in the focus system:
- It attempts to retrieve touch input with a specific `0` id
- It doesn't retrieve touch positions and bases its focus solely on mouse position, absent from mobile devices

## Solution

I added a few methods to the `Touches` resource, allowing to check if **any** touch input was pressed, released or cancelled and to retrieve the *position* of the first pressed touch input and adapted the focus system.

I added a test button to the *iOS* example and it works correclty on emulator. I did not test on a real touch device as:
- Android is not working (https://github.com/bevyengine/bevy/issues/3249)
- I don't have an iOS device
2022-06-20 20:32:19 +00:00
..
axis.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
gamepad.rs Change gamepad.rs tuples to normal structs (#4519) 2022-05-02 13:20:55 +00:00
input.rs Add Input::reset_all (#5015) 2022-06-20 18:31:46 +00:00
keyboard.rs Update keyboard.rs docs in bevy_input (#4517) 2022-05-17 04:16:54 +00:00
lib.rs Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
mouse.rs Implement Eq and PartialEq for MouseScrollUnit (#5048) 2022-06-19 16:53:49 +00:00
touch.rs Fixed bevy_ui touch input (#4099) 2022-06-20 20:32:19 +00:00