Fix QGuiApplication::queryKeyboardModifiers() on macOS

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ø <tor.arne.vestbo@qt.io>
This commit is contained in:
Nils Jeisecke 2018-07-12 18:49:41 +02:00 committed by Timur Pocheptsov
parent 9c99a13d9e
commit 0aea57dfc8

View File

@ -352,7 +352,7 @@ QCocoaKeyMapper::~QCocoaKeyMapper()
Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers()
{ {
return qt_mac_get_modifiers(GetCurrentEventKeyModifiers()); return qt_mac_get_modifiers(GetCurrentKeyModifiers());
} }
bool QCocoaKeyMapper::updateKeyboard() bool QCocoaKeyMapper::updateKeyboard()