From e6cef55ae17024e6cff72b575c22890a52f245b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 11 Sep 2010 10:18:35 +0000 Subject: [PATCH] No real changes, just use KF_EXTENDED instead of hard-coded bit mask. KF_EXTENDED is defined in Windows headers as the mask for extracting the "extended" bit from LPARAM of the keyboard messages. Use it instead of explicitly writing less clear "1 << 24". git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 64bb9dca0c..b2699fd98e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -6023,8 +6023,8 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont& the_font) namespace { -// use the "extended" bit (24) of lParam to distinguish extended keys -// from normal keys as the same key is sent +// use the "extended" bit of lParam to distinguish extended keys from normal +// keys as the same virtual key code is sent for both by Windows inline int ChooseNormalOrExtended(int lParam, int keyNormal, int keyExtended) { @@ -6032,7 +6032,7 @@ int ChooseNormalOrExtended(int lParam, int keyNormal, int keyExtended) // WM_KEYDOWN but are just translating just a VK constant (e.g. done from // msw/treectrl.cpp when processing TVN_KEYDOWN) -- then assume this is a // non-numpad (hence extended) key as this is a more common case - return !lParam || (lParam & (1 << 24)) ? keyExtended : keyNormal; + return !lParam || (HIWORD(lParam) & KF_EXTENDED) ? keyExtended : keyNormal; } // this array contains the Windows virtual key codes which map one to one to @@ -6189,7 +6189,7 @@ int wxCharCodeMSWToWX(int vk, WXLPARAM lParam) case VK_RETURN: // don't use ChooseNormalOrExtended() here as the keys are reversed // here: numpad enter is the extended one - wxk = lParam && (lParam & (1 << 24)) ? WXK_NUMPAD_ENTER : WXK_RETURN; + wxk = HIWORD(lParam) & KF_EXTENDED ? WXK_NUMPAD_ENTER : WXK_RETURN; break; default: -- 2.45.2