mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user