summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorL. Krause <eska@eska.me>2017-07-28 05:39:25 +0200
committerL. Krause <eska@eska.me>2017-07-28 05:39:25 +0200
commit0c693595d68a0e9aa0b0381f86a57a65e2f95e74 (patch)
tree05fd9d3b8eeae14994493af7b5765deaf7e035d4 /platform
parent246b574909f3ae1610001927b773d5b0f2c887e8 (diff)
Implement touch-screen check in HTML5 platform
Diffstat (limited to 'platform')
-rw-r--r--platform/javascript/os_javascript.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 0708d46196..168c513ae1 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -857,7 +857,11 @@ void OS_JavaScript::process_accelerometer(const Vector3 &p_accelerometer) {
bool OS_JavaScript::has_touchscreen_ui_hint() const {
- return false; //???
+ /* clang-format off */
+ return EM_ASM_INT_V(
+ return 'ontouchstart' in window;
+ );
+ /* clang-format on */
}
void OS_JavaScript::main_loop_request_quit() {