summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-07 14:49:33 +0200
committerGitHub <noreply@github.com>2017-08-07 14:49:33 +0200
commit6d213909cb516207304900575ab5c2d9b79e4b20 (patch)
treeb7378d846e8c5e573a8df79241a7bd28e33fc964 /platform/javascript
parent4775d0797787d3f0c2fb571abe723055bbb2b6c5 (diff)
parent0c693595d68a0e9aa0b0381f86a57a65e2f95e74 (diff)
Merge pull request #10105 from eska014/html5-touch-hint
Implement OS.has_touchscreen_ui_hint() in HTML5 platform
Diffstat (limited to 'platform/javascript')
-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 fbba1dd158..5513fca809 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -872,7 +872,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() {