don't generate ACTIVATE events for Alt-Space key press
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2817,8 +2817,8 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
// fabricate the lParam and wParam parameters sufficiently
|
// fabricate the lParam and wParam parameters sufficiently
|
||||||
// similar to the ones from a "real" WM_KEYDOWN so that
|
// similar to the ones from a "real" WM_KEYDOWN so that
|
||||||
// CreateKeyEvent() works correctly
|
// CreateKeyEvent() works correctly
|
||||||
WXLPARAM lParam =
|
const bool isAltDown = ::GetKeyState(VK_MENU) < 0;
|
||||||
(::GetKeyState(VK_MENU) < 0 ? KF_ALTDOWN : 0) << 16;
|
WXLPARAM lParam = (isAltDown ? KF_ALTDOWN : 0) << 16;
|
||||||
|
|
||||||
WXWPARAM wParam = info->wVKey;
|
WXWPARAM wParam = info->wVKey;
|
||||||
|
|
||||||
@@ -2836,7 +2836,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
wParam);
|
wParam);
|
||||||
|
|
||||||
// a separate event for Space/Return
|
// a separate event for Space/Return
|
||||||
if ( !wxIsCtrlDown() && !wxIsShiftDown() &&
|
if ( !wxIsCtrlDown() && !wxIsShiftDown() && !isAltDown &&
|
||||||
((info->wVKey == VK_SPACE) || (info->wVKey == VK_RETURN)) )
|
((info->wVKey == VK_SPACE) || (info->wVKey == VK_RETURN)) )
|
||||||
{
|
{
|
||||||
wxTreeEvent event2(wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
|
wxTreeEvent event2(wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
|
||||||
|
Reference in New Issue
Block a user