From 0aea57dfc8e24262015ad1194b70302deb1afd21 Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Thu, 12 Jul 2018 18:49:41 +0200 Subject: Fix QGuiApplication::queryKeyboardModifiers() on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To quote the documentation: Queries and returns the state of the modifier keys on the keyboard. Unlike keyboardModifiers, this method returns the actual keys held on the input device at the time of calling the method. So GetCurrentKeyModifiers seems to be the correct Carbon function to use. [ChangeLog][QtGui][QGuiApplication] Fix queryKeyboardModifiers() on macOS to actually return the current modifier key state Change-Id: I11f2ef1897a39aea13df4afbfebb8172ca803a30 Task-number: QTBUG-26413 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoakeymapper.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm index 5408178824..5e279a400b 100644 --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm @@ -352,7 +352,7 @@ QCocoaKeyMapper::~QCocoaKeyMapper() Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() { - return qt_mac_get_modifiers(GetCurrentEventKeyModifiers()); + return qt_mac_get_modifiers(GetCurrentKeyModifiers()); } bool QCocoaKeyMapper::updateKeyboard() -- cgit v1.2.3