Show details of key events in the control in dataview sample

This is just to make it more obvious that we get these events.

See #15377.
This commit is contained in:
Vadim Zeitlin 2022-10-03 20:02:58 +02:00
parent f2da7beb36
commit ffbcbd78b1

View file

@ -1767,6 +1767,19 @@ void MyFrame::OnSorted( wxDataViewEvent &event )
void MyFrame::OnDataViewChar(wxKeyEvent& event)
{
wxString key;
#if wxUSE_UNICODE
if ( event.GetUnicodeKey() != WXK_NONE )
key.Printf("\"%c\"", event.GetUnicodeKey());
else
#endif
if ( event.GetKeyCode() != WXK_NONE )
key.Printf("wxKeyCode(%d)", event.GetKeyCode());
else
key = "unknown key";
wxLogMessage("wxEVT_CHAR for %s", key);
if ( event.GetKeyCode() == WXK_DELETE )
DeleteSelectedItems();
else