You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Add support for pointer capture
This commit is contained in:
@@ -274,10 +274,10 @@ Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_han
|
||||
}
|
||||
|
||||
void OS_Android::set_mouse_mode(MouseMode p_mode) {
|
||||
if (!godot_java->get_godot_view()->can_update_pointer_icon()) {
|
||||
if (!godot_java->get_godot_view()->can_update_pointer_icon() || !godot_java->get_godot_view()->can_capture_pointer()) {
|
||||
return;
|
||||
}
|
||||
if (mouse_mode == p_mode || p_mode == MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
if (mouse_mode == p_mode) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -287,6 +287,12 @@ void OS_Android::set_mouse_mode(MouseMode p_mode) {
|
||||
set_cursor_shape(cursor_shape);
|
||||
}
|
||||
|
||||
if (p_mode == MouseMode::MOUSE_MODE_CAPTURED) {
|
||||
godot_java->get_godot_view()->request_pointer_capture();
|
||||
} else {
|
||||
godot_java->get_godot_view()->release_pointer_capture();
|
||||
}
|
||||
|
||||
mouse_mode = p_mode;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user