mirror of https://github.com/qt/qtbase.git
Windows: Implement QWindowsIntegration::queryKeyboardModifiers()
Use code from Qt 4.8. Change-Id: I32d220e04d13ee1e692c0c58268b827bcf519dc7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
6e278b8688
commit
cf36e571ee
|
@ -56,6 +56,7 @@
|
||||||
#include "qwindowsdrag.h"
|
#include "qwindowsdrag.h"
|
||||||
#include "qwindowsinputcontext.h"
|
#include "qwindowsinputcontext.h"
|
||||||
#include "qwindowsaccessibility.h"
|
#include "qwindowsaccessibility.h"
|
||||||
|
#include "qwindowskeymapper.h"
|
||||||
|
|
||||||
#include <QtGui/QPlatformNativeInterface>
|
#include <QtGui/QPlatformNativeInterface>
|
||||||
#include <QtGui/QWindowSystemInterface>
|
#include <QtGui/QWindowSystemInterface>
|
||||||
|
@ -321,6 +322,11 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
|
||||||
return QPlatformIntegration::styleHint(hint);
|
return QPlatformIntegration::styleHint(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Qt::KeyboardModifiers QWindowsIntegration::queryKeyboardModifiers() const
|
||||||
|
{
|
||||||
|
return QWindowsKeyMapper::queryKeyboardModifiers();
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformNativeInterface *QWindowsIntegration::nativeInterface() const
|
QPlatformNativeInterface *QWindowsIntegration::nativeInterface() const
|
||||||
{
|
{
|
||||||
return &d->m_nativeInterface;
|
return &d->m_nativeInterface;
|
||||||
|
|
|
@ -73,6 +73,8 @@ public:
|
||||||
QPlatformServices *services() const;
|
QPlatformServices *services() const;
|
||||||
virtual QVariant styleHint(StyleHint hint) const;
|
virtual QVariant styleHint(StyleHint hint) const;
|
||||||
|
|
||||||
|
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
|
||||||
|
|
||||||
static QWindowsIntegration *instance();
|
static QWindowsIntegration *instance();
|
||||||
|
|
||||||
inline void emitScreenAdded(QPlatformScreen *s) { screenAdded(s); }
|
inline void emitScreenAdded(QPlatformScreen *s) { screenAdded(s); }
|
||||||
|
|
|
@ -1072,4 +1072,16 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Qt::KeyboardModifiers QWindowsKeyMapper::queryKeyboardModifiers()
|
||||||
|
{
|
||||||
|
Qt::KeyboardModifiers modifiers = Qt::NoModifier;
|
||||||
|
if (GetKeyState(VK_SHIFT) < 0)
|
||||||
|
modifiers |= Qt::ShiftModifier;
|
||||||
|
if (GetKeyState(VK_CONTROL) < 0)
|
||||||
|
modifiers |= Qt::ControlModifier;
|
||||||
|
if (GetKeyState(VK_MENU) < 0)
|
||||||
|
modifiers |= Qt::AltModifier;
|
||||||
|
return modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
|
@ -69,6 +69,8 @@ public:
|
||||||
QWindow *keyGrabber() const { return m_keyGrabber; }
|
QWindow *keyGrabber() const { return m_keyGrabber; }
|
||||||
void setKeyGrabber(QWindow *w) { m_keyGrabber = w; }
|
void setKeyGrabber(QWindow *w) { m_keyGrabber = w; }
|
||||||
|
|
||||||
|
static Qt::KeyboardModifiers queryKeyboardModifiers();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool translateKeyEventInternal(QWindow *receiver, const MSG &msg, bool grab);
|
bool translateKeyEventInternal(QWindow *receiver, const MSG &msg, bool grab);
|
||||||
void updateKeyMap(const MSG &msg);
|
void updateKeyMap(const MSG &msg);
|
||||||
|
|
Loading…
Reference in New Issue