X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b6885972eeaa04d4362950e0863e5e07da2770fd..a8fc3508e77811dbce06afa7703cfbeb3b037962:/samples/keyboard/keyboard.cpp?ds=sidebyside diff --git a/samples/keyboard/keyboard.cpp b/samples/keyboard/keyboard.cpp index 13c1cd0731..f218f6bbaf 100644 --- a/samples/keyboard/keyboard.cpp +++ b/samples/keyboard/keyboard.cpp @@ -335,7 +335,12 @@ const char* GetVirtualKeyCodeName(int keycode) WXK_(NUMPAD_SUBTRACT) WXK_(NUMPAD_DECIMAL) WXK_(NUMPAD_DIVIDE) + + WXK_(WINDOWS_LEFT) + WXK_(WINDOWS_RIGHT) + WXK_(COMMAND) #undef WXK_ + 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); + #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 + + return "unknown"; }