report Unicode characters when reporting EVT_CHAR in keyboard sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-04-28 11:09:20 +00:00
parent 7ef3025745
commit 52bbab36a2

View File

@@ -472,12 +472,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
{