summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmeventtranslator.h
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2022-01-17 07:25:26 +1000
committerLorn Potter <lorn.potter@gmail.com>2022-03-03 12:30:59 +1000
commit66a76a5def46d0e4a330f7130ad440c639b87cf7 (patch)
tree88a05b0a11fce75c7a672e16957c7d9f4f3bff0c /src/plugins/platforms/wasm/qwasmeventtranslator.h
parent6f5c78fe3d445f1c6c8738f9cedb9dbd847645fa (diff)
wasm: enable mobile native keyboarding
This works on iOS and Android, and Windows with touchscreen. On Android, we need to listen to the input event of a hidden text element and synthesize Qt keyboard events from that in order to get input events into Qt. On Windows, we need to be more creative about bringing the native virtual keyboard up. Because the entire canvas is contenteditable, we need to specify the inputmode is set to 'none', otherwise the v keyboard pops up when user clicks anywhere on the canvas. Therefore we set a hidden element as contenteditable, which pops up keyboard when Qt needs it for editable widgets. On Android, this is the same element that is used to proxy the keyboard input. [ChangeLog][wasm] Add support for native mobile keyboard Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Fixes: QTBUG-83064 Fixes: QTBUG-88803 Change-Id: I769fe344fc10c17971bd1c0a603501040fe82653 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmeventtranslator.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.h b/src/plugins/platforms/wasm/qwasmeventtranslator.h
index 341971d79f..d7a1fa331a 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.h
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.h
@@ -67,11 +67,11 @@ public:
void setStickyDeadKey(const EmscriptenKeyboardEvent *keyEvent);
void setIsMac(bool is_mac) {g_usePlatformMacSpecifics = is_mac;};
+ bool g_usePlatformMacSpecifics = false;
Q_SIGNALS:
void getWindowAt(const QPoint &point, QWindow **window);
private:
- bool g_usePlatformMacSpecifics = false;
static Qt::Key translateDeadKey(Qt::Key deadKey, Qt::Key accentBaseKey, bool is_mac = false);
private: