git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26290
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// ---------------------------------------------------------------------------
// kbd code translation
// ---------------------------------------------------------------------------
// kbd code translation
-WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
+WXDLLEXPORT int wxCharCodeMSWToWX(int keySym, WXLPARAM lParam = 0);
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
// window creation helper class: before creating a new HWND, instantiate an
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
// window creation helper class: before creating a new HWND, instantiate an
m_xThumbSize = 0;
m_yThumbSize = 0;
m_xThumbSize = 0;
m_yThumbSize = 0;
- // as all windows are created with WS_VISIBLE style...
- m_isShown = true;
-
#if wxUSE_MOUSEEVENT_HACK
m_lastMouseX =
m_lastMouseY = -1;
#if wxUSE_MOUSEEVENT_HACK
m_lastMouseX =
m_lastMouseY = -1;
msflags &= ~WS_BORDER;
#endif // wxUniversal
msflags &= ~WS_BORDER;
#endif // wxUniversal
- // all windows are created visible by default except popup ones (which are
- // like the wxTopLevelWindows in this aspect)
- if ( style & wxPOPUP_WINDOW )
- {
- msflags &= ~WS_VISIBLE;
- m_isShown = false;
- }
- else
{
msflags |= WS_VISIBLE;
}
{
msflags |= WS_VISIBLE;
}
}
else // we're called from WM_KEYDOWN
{
}
else // we're called from WM_KEYDOWN
{
- id = wxCharCodeMSWToWX(wParam);
+ id = wxCharCodeMSWToWX(wParam, lParam);
if ( id == 0 )
{
// it's ASCII and will be processed here only when called from
if ( id == 0 )
{
// it's ASCII and will be processed here only when called from
bool wxWindowMSW::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
{
bool wxWindowMSW::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
{
- int id = wxCharCodeMSWToWX(wParam);
+ int id = wxCharCodeMSWToWX(wParam, lParam);
bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
{
bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
{
- int id = wxCharCodeMSWToWX(wParam);
+ int id = wxCharCodeMSWToWX(wParam, lParam);
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
-int wxCharCodeMSWToWX(int keySym)
+int wxCharCodeMSWToWX(int keySym, WXLPARAM lParam)
{
int id;
switch (keySym)
{
int id;
switch (keySym)
case VK_BACK: id = WXK_BACK; break;
case VK_TAB: id = WXK_TAB; break;
case VK_CLEAR: id = WXK_CLEAR; break;
case VK_BACK: id = WXK_BACK; break;
case VK_TAB: id = WXK_TAB; break;
case VK_CLEAR: id = WXK_CLEAR; break;
- case VK_RETURN: id = WXK_RETURN; break;
case VK_SHIFT: id = WXK_SHIFT; break;
case VK_CONTROL: id = WXK_CONTROL; break;
case VK_MENU : id = WXK_MENU; break;
case VK_SHIFT: id = WXK_SHIFT; break;
case VK_CONTROL: id = WXK_CONTROL; break;
case VK_MENU : id = WXK_MENU; break;
case VK_APPS: id = WXK_WINDOWS_MENU; break;
#endif // VK_APPS defined
case VK_APPS: id = WXK_WINDOWS_MENU; break;
#endif // VK_APPS defined
+ case VK_RETURN:
+ // the same key is sent for both the "return" key on the main
+ // keyboard and the numeric keypad but we want to distinguish
+ // between them: we do this using the "extended" bit (24) of lParam
+ id = lParam & (1 << 24) ? WXK_NUMPAD_ENTER : WXK_RETURN;
+ break;
+
DWORD hiWord = HIWORD(lParam);
if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) )
{
DWORD hiWord = HIWORD(lParam);
if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) )
{
- int id = wxCharCodeMSWToWX(wParam);
+ int id = wxCharCodeMSWToWX(wParam, lParam);
if ( id != 0 )
{
wxKeyEvent event(wxEVT_CHAR_HOOK);
if ( id != 0 )
{
wxKeyEvent event(wxEVT_CHAR_HOOK);