From a8ff5c5b0720503bda72a225e9679fd0d25aa68b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 25 Dec 2020 01:28:42 +1100 Subject: [PATCH] Try to fix iPad >= iOS 13 not showing touch controls by default --- src/Window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Window.c b/src/Window.c index 099004004..7832f70c6 100644 --- a/src/Window.c +++ b/src/Window.c @@ -3463,7 +3463,12 @@ void Window_Init(void) { }); ); - Input_TouchMode = EM_ASM_INT_V({ return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); }); + /* iOS 13 on iPad doesn't identify itself as iPad by default anymore */ + /* https://stackoverflow.com/questions/57765958/how-to-detect-ipad-and-ipad-os-version-in-ios-13-and-up */ + Input_TouchMode = EM_ASM_INT_V({ + return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || + (navigator.maxTouchPoints && navigator.maxTouchPoints > 2); + }); Pointers_Count = Input_TouchMode ? 0 : 1; /* iOS shifts the whole webpage up when opening chat, which causes problems */