Browse Source

Fixing autocomplete in code editor on Windows

JoshEngebretson 10 years ago
parent
commit
2edcf3727a
2 changed files with 11 additions and 1 deletions
  1. 10 0
      Source/AtomicWebView/WebClient.cpp
  2. 1 1
      Source/AtomicWebView/WebKeyboardWindows.cpp

+ 10 - 0
Source/AtomicWebView/WebClient.cpp

@@ -520,6 +520,16 @@ void WebClient::SendKeyEvent(const StringHash eventType, VariantMap& eventData)
 
     host->SendKeyEvent(keyEvent);
 
+#ifdef ATOMIC_PLATFORM_WINDOWS
+
+    if (keyEvent.windows_key_code == 13)
+    {
+        keyEvent.type = KEYEVENT_CHAR;
+        host->SendKeyEvent(keyEvent);
+    }
+
+#endif
+
 #ifdef ATOMIC_PLATFORM_OSX
     // Send an empty key event on OSX, which seems to fix
     // keyboard problems on OSX with cefclient

+ 1 - 1
Source/AtomicWebView/WebKeyboardWindows.cpp

@@ -86,7 +86,7 @@ bool ConvertKeyEvent(Input* input, const StringHash eventType, VariantMap& event
 
         keyEvent.windows_key_code = VK_RETURN;
         keyEvent.native_key_code = (int) 0;
-        keyEvent.type = KEYEVENT_CHAR;
+        keyEvent.type = KEYEVENT_RAWKEYDOWN;
         return true;
     }