#[Android] How to check is Cursor supported (by winit)? e.g. cursor is not supported in Android

2 messages · Page 1 of 1 (latest)

lethal jetty
#

this code will working fine on PC but crash on android, so i want check is cursor supported before execute it

// if window.cursor.is_supported {  // how to check?
window.cursor.grab_mode = if curr_manipulating { CursorGrabMode::Locked } else { CursorGrabMode::None };
window.cursor.visible = !curr_manipulating;
rough path
#

Worse still, windows doesn't support CursorGrabMode::Locked - though it will try to use the alternative grab mode by default, you may want to handle this specifically
You can do something like rs #[cfg(any(target_os = "android", target_os = "ios"))] { // handle case where cursor is not supported } #[cfg(not(any(target_os = "android", target_os = "ios")))] { // handle case where cursor is supported }