Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorAlexander Kuznetsov <kuzsasha@gmail.com>2012-02-05 20:05:20 +0400
committerAlexander Kuznetsov <kuzsasha@gmail.com>2012-02-05 20:05:20 +0400
commitd51a1f3ed1e7028d4f5f46e86d51db5a07fb2ed3 (patch)
tree34723566ee45bf090c171eba570265beea35be76 /intern
parent04a079668c2d72ea00f2537fa88fdca2728c5aa2 (diff)
Fix for [#30044] on windows
We don't know how ALT key modifies the key, so utf=0; That way Text Object can handle it. * Should be removed when we able to support different keyboards on Windows
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 9cae2c27e65..98c4785797d 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -717,10 +717,11 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
if (key != GHOST_kKeyUnknown) {
char utf8_char[6] = {0} ;
+ char ascii = 0;
wchar_t utf16[2]={0};
- BYTE state[256];
- GetKeyboardState((PBYTE)state);
+ BYTE state[256] ={0};
+ GetKeyboardState(state);
if(ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout))
WideCharToMultiByte(CP_UTF8, 0,
@@ -728,9 +729,14 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
(LPSTR) utf8_char, 5,
NULL,NULL); else *utf8_char = 0;
- if(!keyDown) utf8_char[0] = '\0';
- event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, (*utf8_char & 0x80)?'?':*utf8_char, utf8_char);
+
+ if(!keyDown) {utf8_char[0] = '\0'; ascii='\0';}
+ else ascii = utf8_char[0]& 0x80?'?':utf8_char[0];
+
+ if(0x80&state[VK_MENU]) utf8_char[0]='\0';
+
+ event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, utf8_char);
#ifdef GHOST_DEBUG
std::cout << ascii << std::endl;