]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/keyboard/keyboard.cpp
exposing control key combinations as before, fixing unicodekey casing
[wxWidgets.git] / samples / keyboard / keyboard.cpp
index 13c1cd073119fe461840e59125c4d6bab352e382..f218f6bbaf9cfb1bf218f2ed18424ad65a30ac56 100644 (file)
@@ -335,7 +335,12 @@ const char* GetVirtualKeyCodeName(int keycode)
         WXK_(NUMPAD_SUBTRACT)
         WXK_(NUMPAD_DECIMAL)
         WXK_(NUMPAD_DIVIDE)
         WXK_(NUMPAD_SUBTRACT)
         WXK_(NUMPAD_DECIMAL)
         WXK_(NUMPAD_DIVIDE)
+
+        WXK_(WINDOWS_LEFT)
+        WXK_(WINDOWS_RIGHT)
+        WXK_(COMMAND)
 #undef WXK_
 #undef WXK_
+
     default:
         return NULL;
     }
     default:
         return NULL;
     }
@@ -352,11 +357,14 @@ wxString GetKeyName(const wxKeyEvent &event)
         return wxString::Format("Ctrl-%c", (unsigned char)('A' + keycode - 1));
     if ( keycode >= 32 && keycode < 128 )
         return wxString::Format("'%c'", (unsigned char)keycode);
         return wxString::Format("Ctrl-%c", (unsigned char)('A' + keycode - 1));
     if ( keycode >= 32 && keycode < 128 )
         return wxString::Format("'%c'", (unsigned char)keycode);
+
 #if wxUSE_UNICODE
 #if wxUSE_UNICODE
-    return wxString::Format("'%c'", event.GetUnicodeKey());
-#else
-    return "unknown";
+    int uc = event.GetUnicodeKey();
+    if ( uc != WXK_NONE )
+        return wxString::Format("'%c'", uc);
 #endif
 #endif
+
+    return "unknown";
 }
 
 
 }