and also fixed it. The original version did not work because it tried
to change read-only fields of the event, which is not allowed.
The last commit removed support of touch simulation of Ctrl and Alt
by removing the `virtual_input.coffee` file. This commit brings it back
with a better implementation.
We have already introduced a virtual textarea for every platform.
This one seems redundant.
However, some features may still not work perfectly on a mobile browser
We do not need to listen for keydown and keypress for inputHelper because these events will propagate through the parent.
Listening them will be redundant and will cause some shortcut key combinations to stop working.
Since we now have a hidden `textarea`, there is no longer need to set anything to contentEditable
this fixes#75 and #47, two bugs originated long long ago.
1. Added support for IME events `compositionstart` `compositionupdate` and `compositionend`.
2. Refactored some code to receive input events from a hidden textarea just as how `xterm.js` now does. This removes the need to set `contentEditable` on the body in order to receive IME compistion events, and also guides the IME input box correctly following the cursor.
3. Fixed CJK rendering. Forces "forceWidth" mode with double width on those known CJK ranges in Unicode. Corrected the placeholder logic of the force width mode. Note that some rare halfwidth CJK characters will still not render correctly without `force-unicode-width` enabled. If you see any issue, please enable the `--force-unicode-width` option.
4. Miscallaneous fixes for some problems after introducing the above change
Tested on Firefox Nightly 62 on Linux and Chromium 67 on Linux, with `fcitx` as input method.