diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index b79185b1637..e6ac48fa6c8 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -724,19 +724,25 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP wchar_t utf16[3]={0}; BYTE state[256] ={0}; int r; - GetKeyboardState((PBYTE)state); + GetKeyboardState((PBYTE)state); - if(r = ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout)) - - if((r>0 && r<3)){utf16[r]=0; - - conv_utf_16_to_8(utf16,utf8_char,6);} - else if (r==-1) utf8_char[0] = '\0'; - - + if(r = ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout)) { + if((r>0 && r<3)){ + utf16[r]=0; + conv_utf_16_to_8(utf16,utf8_char,6); + } + else if (r==-1) { + utf8_char[0] = '\0'; + } + } - if(!keyDown) {utf8_char[0] = '\0'; ascii='\0';} - else ascii = utf8_char[0]& 0x80?'?':utf8_char[0]; + 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'; @@ -1253,7 +1259,6 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(bool selection) const if ( IsClipboardFormatAvailable(CF_UNICODETEXT) && OpenClipboard(NULL) ) { wchar_t *buffer; - size_t len = 0; HANDLE hData = GetClipboardData( CF_UNICODETEXT ); if (hData == NULL) { CloseClipboard(); |