From 4bfb464570c0a61c38ff237e8eb8bdc8536a134d Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 19 Apr 2017 10:37:12 +0200 Subject: winrt: Remove wrong parameter from handleExtendedKeyEvent call The event's count parameter is used to determine the number of keys involved in the key event, not the repeat count of the key press. The desktop windows implementation does not pass the "count" parameter, so we omit it as well. The tryShortcutOverride parameter is only used on macOS and thus can be omitted as well. Change-Id: Id7554e43cc73ec616f68444e82a38418e622e20a Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 7ac4bdac6c..19b8b0b827 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -991,9 +991,7 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind virtualKey, 0, QString(), - d->activeKeys.value(key).isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + d->activeKeys.value(key).isAutoRepeat); } else { d->activeKeys.insert(key, KeyInfo(virtualKey)); } @@ -1021,9 +1019,7 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind virtualKey, 0, QString(), - d->activeKeys.value(key).isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + d->activeKeys.value(key).isAutoRepeat); return S_OK; } @@ -1048,9 +1044,7 @@ HRESULT QWinRTScreen::onKeyUp(ABI::Windows::UI::Core::ICoreWindow *, ABI::Window virtualKey, 0, info.text, - false, // The final key release does not have autoRepeat set on Windows - !status.RepeatCount ? 1 : status.RepeatCount, - false); + false); // The final key release does not have autoRepeat set on Windows return S_OK; } @@ -1081,9 +1075,7 @@ HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEvent info.virtualKey, 0, text, - info.isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + info.isAutoRepeat); return S_OK; } -- cgit v1.2.3 From eb77a24faa284245bee83945b80606bb3bdbfd9f Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 19 Apr 2017 13:11:02 +0200 Subject: winrt: Fix text value for key release events The text member was never filled and thus was not set in onKeyUp. Change-Id: I0d0094745c385e0942635da643d863868b010c2a Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 19b8b0b827..6376c33024 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -1065,7 +1065,8 @@ HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEvent const Qt::KeyboardModifiers modifiers = keyboardModifiers(); const Qt::Key key = qKeyFromCode(keyCode, modifiers); const QString text = QChar(keyCode); - const KeyInfo info = d->activeKeys.value(key); + KeyInfo &info = d->activeKeys[key]; + info.text = text; QWindowSystemInterface::handleExtendedKeyEvent( topWindow(), QEvent::KeyPress, -- cgit v1.2.3 From 11e37a0e8c9e2c17d13b1ab44ca9b3f35b7a9844 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 19 Apr 2017 13:11:56 +0200 Subject: winrt: Use list initialization for KeyInfo's members Change-Id: Idd05d1e1332efd9afc9816a48437fee377730735 Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 6376c33024..c370c2ec50 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -100,27 +100,17 @@ QT_BEGIN_NAMESPACE struct KeyInfo { KeyInfo() - : virtualKey(0) - , isAutoRepeat(false) - { - } - - KeyInfo(const QString &text, quint32 virtualKey) - : text(text) - , virtualKey(virtualKey) - , isAutoRepeat(false) { } KeyInfo(quint32 virtualKey) : virtualKey(virtualKey) - , isAutoRepeat(false) { } QString text; - quint32 virtualKey; - bool isAutoRepeat; + quint32 virtualKey{0}; + bool isAutoRepeat{false}; }; static inline Qt::ScreenOrientations qtOrientationsFromNative(DisplayOrientations native) -- cgit v1.2.3