wasm: ignore keypresses if alt and numeric keyboard
When left-alt + num lock activated + number pressed the number was inserted in the text. However in this input mode a 4 digit keycode is used to insert a special character, it is wrong to insert the individual digits in addition Fixes: QTBUG-136799 Pick-to: 6.8 Change-Id: Iebafd1dfe5df1701a87a824ed99a440b122f0c57 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 5c82db79d98d456a9299314fab2e7576db227fd0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
adfc440fc5
commit
e02af544a8
@ -111,6 +111,14 @@ KeyEvent::KeyEvent(EventType type, emscripten::val event) : Event(type, event)
|
|||||||
key = webKeyToQtKey(code, webKey, deadKey, modifiers);
|
key = webKeyToQtKey(code, webKey, deadKey, modifiers);
|
||||||
|
|
||||||
text = QString::fromUtf8(webKey);
|
text = QString::fromUtf8(webKey);
|
||||||
|
|
||||||
|
// Alt + keypad number -> insert utf-8 character
|
||||||
|
// The individual numbers shall not be inserted but
|
||||||
|
// on some platforms they are if numlock is
|
||||||
|
// activated
|
||||||
|
if ((modifiers & Qt::AltModifier) && (modifiers & Qt::KeypadModifier))
|
||||||
|
text.clear();
|
||||||
|
|
||||||
if (text.size() > 1)
|
if (text.size() > 1)
|
||||||
text.clear();
|
text.clear();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user