From: Vadim Zeitlin Date: Sun, 11 Nov 2001 20:39:28 +0000 (+0000) Subject: fixed key event code for ASCII keys in wxListCtrl X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/185d0094f891202d7de486ad5a295a8fe88b84a7 fixed key event code for ASCII keys in wxListCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index c527a6f0d3..f16980f75f 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1694,7 +1694,11 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) else { eventType = wxEVT_COMMAND_LIST_KEY_DOWN; - event.m_code = wxCharCodeMSWToWX(wVKey); + + // wxCharCodeMSWToWX() returns 0 if the key is an ASCII + // value which should be used as is + int code = wxCharCodeMSWToWX(wVKey); + event.m_code = code ? code : wVKey; } event.m_itemIndex =