]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
Crash fix under VC++
[wxWidgets.git] / src / gtk1 / window.cpp
index 8878e9dbba83c51efaae9a80bd005ef1dbe78280..11167b3844aeab055383a382142bd4424c05e4bb 100644 (file)
@@ -1203,15 +1203,16 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
         key_code = wxTranslateKeySymToWXKey(keysym, TRUE /* isChar */);
         if ( !key_code )
         {
-            if ( gdk_event->length == 1 )
-            {
-                key_code = (unsigned char)gdk_event->string[0];
-            }
-            else if ( wxIsAsciiKeysym(keysym) )
+            if ( wxIsAsciiKeysym(keysym) )
             {
                 // ASCII key
                 key_code = (unsigned char)keysym;
             }
+            // gdk_event->string is actually deprecated
+            else if ( gdk_event->length == 1 )
+            {
+                key_code = (unsigned char)gdk_event->string[0];
+            }
         }
 
         if ( key_code )