mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Input logic cleanup:
- Fix invalid detection of mouse input. Prioritize using the event tool type to detect the type of the event, and only use the event source as fallback. - Ensure that pressure and tilt information is passed for touch drag events - Consolidate logic and remove redundant methods - Improve the logic to detect when external hardware keyboards are connected to the device
This commit is contained in:
parent
daa81bbb7d
commit
625b92e3cd
6 changed files with 133 additions and 126 deletions
|
@ -176,6 +176,8 @@ void AndroidInputHandler::process_touch_event(int p_event, int p_pointer, const
|
|||
for (int i = 0; i < p_points.size(); i++) {
|
||||
touch.write[i].id = p_points[i].id;
|
||||
touch.write[i].pos = p_points[i].pos;
|
||||
touch.write[i].pressure = p_points[i].pressure;
|
||||
touch.write[i].tilt = p_points[i].tilt;
|
||||
}
|
||||
|
||||
//send touch
|
||||
|
@ -208,6 +210,8 @@ void AndroidInputHandler::process_touch_event(int p_event, int p_pointer, const
|
|||
ev->set_position(p_points[idx].pos);
|
||||
ev->set_relative(p_points[idx].pos - touch[i].pos);
|
||||
ev->set_relative_screen_position(ev->get_relative());
|
||||
ev->set_pressure(p_points[idx].pressure);
|
||||
ev->set_tilt(p_points[idx].tilt);
|
||||
Input::get_singleton()->parse_input_event(ev);
|
||||
touch.write[i].pos = p_points[idx].pos;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue