virtualx-engine/platform/javascript
Pedro J. Estébanez de9d40a953 Implement universal translation of touch to mouse
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*)

The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers.

Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse.

*: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest.

On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction.

Plus: Improve/fix tracking of current mouse position.

** Summary of changes to settings: **

- `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse`
- New setting: `input/pointing_devices/emulate_mouse_from_touch`
2018-04-30 19:03:38 +02:00
..
api
export
audio_driver_javascript.cpp
audio_driver_javascript.h
detect.py Merge pull request #17792 from eska014/enginejs-preloadpaths 2018-04-04 22:26:14 +02:00
dom_keys.h
engine.js Fix engine.js startGame() when loading from directory 2018-03-27 11:26:34 +02:00
http_client.h.inc Warn when polling HTTPClient synchronously in HTML5 platform 2018-02-17 18:12:50 +01:00
http_client_javascript.cpp Fix bug in HTML5 HTTPClient. 2018-03-30 14:31:18 +02:00
http_request.h
http_request.js
javascript_eval.cpp
javascript_main.cpp Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00
logo.png
os_javascript.cpp Implement universal translation of touch to mouse 2018-04-30 19:03:38 +02:00
os_javascript.h Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00
platform_config.h
pre.js Expose Emscripten libs to engine.js discreetly 2018-03-27 09:12:08 +02:00
run_icon.png
SCsub Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00