diff options
author | Bjoern Breitmeyer <bjoern.breitmeyer@kdab.com> | 2012-05-10 14:43:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-10 22:56:25 +0200 |
commit | 9b9895de8da08776e586f20807d4698e5d9e5680 (patch) | |
tree | c76d3316e75c93a6c993f0fea148f496cd3b291a /src/plugins/platforms/windows/qwindowskeymapper.cpp | |
parent | 4e8c20e97e17881e2de20640f81c3998f024287d (diff) |
Fix for windows platform plugin to work with WINCE.
Made opengl optional.
Made Clipboard and Accessability optional.
Moved internal mime data into its on source file,
was implemented in the clipboard source
which is just strange.
Change-Id: I6ddf0c656533bd45e22e24492fc2254d15b7822f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 4b5e95824a..25d3d43bfb 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -444,6 +444,34 @@ inline int winceKeyBend(int keyCode) return KeyTbl[keyCode]; } +#ifdef Q_OS_WINCE +QT_BEGIN_INCLUDE_NAMESPACE +int ToUnicode(UINT vk, int /*scancode*/, unsigned char* /*kbdBuffer*/, LPWSTR unicodeBuffer, int, int) +{ + QT_USE_NAMESPACE + QChar* buf = reinterpret_cast< QChar*>(unicodeBuffer); + if (KeyTbl[vk] == 0) { + buf[0] = vk; + return 1; + } + return 0; +} + +int ToAscii(UINT vk, int scancode, unsigned char *kbdBuffer, LPWORD unicodeBuffer, int flag) +{ + return ToUnicode(vk, scancode, kbdBuffer, (LPWSTR) unicodeBuffer, 0, flag); + +} + +bool GetKeyboardState(unsigned char* kbuffer) +{ + for (int i=0; i< 256; ++i) + kbuffer[i] = GetAsyncKeyState(i); + return true; +} +QT_END_INCLUDE_NAMESPACE +#endif // Q_OS_WINCE + // Translate a VK into a Qt key code, or unicode character static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, bool *isDeadkey = 0) { @@ -672,6 +700,7 @@ static void showSystemMenu(QWindow* w) if (!menu) return; // no menu for this window +#ifndef Q_OS_WINCE #define enabled (MF_BYCOMMAND | MF_ENABLED) #define disabled (MF_BYCOMMAND | MF_GRAYED) @@ -696,6 +725,7 @@ static void showSystemMenu(QWindow* w) #undef enabled #undef disabled +#endif // !Q_OS_WINCE const int ret = TrackPopupMenuEx(menu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD, topLevel->geometry().x(), topLevel->geometry().y(), @@ -1014,6 +1044,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms Qt::KeyboardModifier(state), scancode, msg.wParam, nModifiers, text, false, 0); result =true; bool store = true; +#ifndef Q_OS_WINCE // Alt+<alphanumerical> go to the Win32 menu system if unhandled by Qt if (msgType == WM_SYSKEYDOWN && !result && a) { HWND parent = GetParent(QWindowsWindow::handleOf(receiver)); @@ -1027,6 +1058,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms parent = GetParent(parent); } } +#endif // !Q_OS_WINCE if (!store) key_recorder.findKey(msg.wParam, true); } @@ -1055,6 +1087,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms Qt::KeyboardModifier(state), scancode, msg.wParam, nModifiers, (rec ? rec->text : QString()), false, 0); result = true; +#ifndef Q_OS_WINCE // don't pass Alt to Windows unless we are embedded in a non-Qt window if (code == Qt::Key_Alt) { const QWindowsContext *context = QWindowsContext::instance(); @@ -1067,6 +1100,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms parent = GetParent(parent); } } +#endif } } return result; |