no real changes, just some cleanup: add wxIsAltDown() in addition to the existing wxIsShift/CtrlDown() and wxIsAnyModifiedDown() to test for all of them at once (slightly modified patch 1833235)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1948,11 +1948,9 @@ bool wxTreeCtrl::MSWShouldPreProcessMessage(WXMSG* msg)
|
||||
{
|
||||
if ( msg->message == WM_KEYDOWN )
|
||||
{
|
||||
const bool isAltDown = ::GetKeyState(VK_MENU) < 0;
|
||||
|
||||
// Only eat VK_RETURN if not being used by the application in conjunction with
|
||||
// modifiers
|
||||
if ( msg->wParam == VK_RETURN && !wxIsCtrlDown() && !wxIsShiftDown() && !isAltDown)
|
||||
// Only eat VK_RETURN if not being used by the application in
|
||||
// conjunction with modifiers
|
||||
if ( (msg->wParam == VK_RETURN) && !wxIsAnyModifierDown() )
|
||||
{
|
||||
// we need VK_RETURN to generate wxEVT_COMMAND_TREE_ITEM_ACTIVATED
|
||||
return false;
|
||||
@@ -2607,8 +2605,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
// fabricate the lParam and wParam parameters sufficiently
|
||||
// similar to the ones from a "real" WM_KEYDOWN so that
|
||||
// CreateKeyEvent() works correctly
|
||||
const bool isAltDown = ::GetKeyState(VK_MENU) < 0;
|
||||
WXLPARAM lParam = (isAltDown ? KF_ALTDOWN : 0) << 16;
|
||||
WXLPARAM lParam = (wxIsAltDown() ? KF_ALTDOWN : 0) << 16;
|
||||
|
||||
WXWPARAM wParam = info->wVKey;
|
||||
|
||||
@@ -2626,7 +2623,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
wParam);
|
||||
|
||||
// a separate event for Space/Return
|
||||
if ( !wxIsCtrlDown() && !wxIsShiftDown() && !isAltDown &&
|
||||
if ( !wxIsAnyModifierDown() &&
|
||||
((info->wVKey == VK_SPACE) || (info->wVKey == VK_RETURN)) )
|
||||
{
|
||||
wxTreeItemId item;
|
||||
|
Reference in New Issue
Block a user