X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4db172a3b318df9aff178eb6c5da149d56e0859..ff7d9066dae29da2bcfe611b62bcb276ce2afff0:/src/mgl/window.cpp diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index db89438703..d4fc3b24e5 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -35,6 +35,8 @@ #include "wx/panel.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/dcscreen.h" + #include "wx/menu.h" #endif #if wxUSE_DRAG_AND_DROP @@ -43,7 +45,6 @@ #include "wx/sysopt.h" #include "wx/mgl/private.h" -#include "wx/dcscreen.h" #include "wx/caret.h" #include @@ -296,23 +297,25 @@ static long wxScanToKeyCode(event_t *event, bool translate) if ( translate ) { + bool numlock = (event->modifiers & EVT_NUMLOCK) != 0; + switch ( EVT_scanCode(event->message) ) { KEY (KB_padMinus, WXK_NUMPAD_SUBTRACT) KEY (KB_padPlus, WXK_NUMPAD_ADD) KEY (KB_padTimes, WXK_NUMPAD_MULTIPLY) KEY (KB_padDivide, WXK_NUMPAD_DIVIDE) - KEY (KB_padCenter, WXK_NUMPAD_SEPARATOR) // ? - KEY (KB_padLeft, WXK_NUMPAD_LEFT) - KEY (KB_padRight, WXK_NUMPAD_RIGHT) - KEY (KB_padUp, WXK_NUMPAD_UP) - KEY (KB_padDown, WXK_NUMPAD_DOWN) - KEY (KB_padInsert, WXK_NUMPAD_INSERT) - KEY (KB_padDelete, WXK_NUMPAD_DELETE) - KEY (KB_padHome, WXK_NUMPAD_HOME) - KEY (KB_padEnd, WXK_NUMPAD_END) - KEY (KB_padPageUp, WXK_NUMPAD_PAGEUP) - KEY (KB_padPageDown, WXK_NUMPAD_PAGEDOWN) + KEY (KB_padCenter, numlock ? WXK_NUMPAD5 : WXK_NUMPAD_SEPARATOR) // ? + KEY (KB_padLeft, numlock ? WXK_NUMPAD4 : WXK_NUMPAD_LEFT) + KEY (KB_padRight, numlock ? WXK_NUMPAD6 : WXK_NUMPAD_RIGHT) + KEY (KB_padUp, numlock ? WXK_NUMPAD8 : WXK_NUMPAD_UP) + KEY (KB_padDown, numlock ? WXK_NUMPAD2 : WXK_NUMPAD_DOWN) + KEY (KB_padInsert, numlock ? WXK_NUMPAD0 : WXK_NUMPAD_INSERT) + KEY (KB_padDelete, numlock ? WXK_DECIMAL : WXK_NUMPAD_DELETE) + KEY (KB_padHome, numlock ? WXK_NUMPAD7 : WXK_NUMPAD_HOME) + KEY (KB_padEnd, numlock ? WXK_NUMPAD1 : WXK_NUMPAD_END) + KEY (KB_padPageUp, numlock ? WXK_NUMPAD9 : WXK_NUMPAD_PAGEUP) + KEY (KB_padPageDown, numlock ? WXK_NUMPAD3 : WXK_NUMPAD_PAGEDOWN) KEY (KB_1, '1') KEY (KB_2, '2') KEY (KB_3, '3') @@ -1095,7 +1098,6 @@ void wxWindowMGL::Clear() dc.Clear(); } -#include "wx/menu.h" void wxWindowMGL::Refresh(bool eraseBack, const wxRect *rect) { if ( m_eraseBackground == -1 )