report Unicode characters when reporting EVT_CHAR in keyboard sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-04-28 11:09:33 +00:00
parent 824ff8bd8a
commit a772b79eb1

View File

@@ -464,12 +464,24 @@ void TextWindow::LogEvent(const wxChar *name, wxKeyEvent& event)
if ( keycode < 256 )
{
if ( keycode == 0 )
key.Printf(_T("NUL"));
{
#if wxUSE_UNICODE
const wxChar u = event.GetUnicodeKey();
if ( u )
key.Printf(_T("Unicode char '%c' (U+%04x)"), u, u);
else
#endif
key.Printf(_T("NUL"));
}
else if ( keycode < 27 )
{
key.Printf(_T("Ctrl-%c"),
(unsigned char)(_T('A') + keycode - 1));
}
else
{
key.Printf(_T("'%c'"), (unsigned char)keycode);
}
}
else
{