fix F10 hotkey on Windows
This commit is contained in:
parent
6db87aa78b
commit
dc08ba2e17
|
@ -416,11 +416,12 @@ void WIN32Window::poll()
|
||||||
|
|
||||||
Fw::Key WIN32Window::retranslateVirtualKey(WPARAM wParam, LPARAM lParam)
|
Fw::Key WIN32Window::retranslateVirtualKey(WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
if(!(((HIWORD(lParam) >> 8) & 0xFF) & 1)) {
|
// ignore numpad keys when numlock is on
|
||||||
// ignore numpad keys when numlock is on
|
if((wParam >= VK_NUMPAD0 && wParam <= VK_NUMPAD9) || wParam == VK_SEPARATOR)
|
||||||
if((wParam >= VK_NUMPAD0 && wParam <= VK_NUMPAD9) || wParam == VK_SEPARATOR)
|
return Fw::KeyUnknown;
|
||||||
return Fw::KeyUnknown;
|
|
||||||
|
|
||||||
|
// lParam will have this state when receiving insert,end,down,etc presses from numpad
|
||||||
|
if(!(((HIWORD(lParam) >> 8) & 0xFF) & 1)) {
|
||||||
// retranslate numpad keys
|
// retranslate numpad keys
|
||||||
switch(wParam) {
|
switch(wParam) {
|
||||||
case VK_INSERT:
|
case VK_INSERT:
|
||||||
|
@ -475,7 +476,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
if(m_cursor)
|
if(m_cursor)
|
||||||
SetCursor(m_cursor);
|
SetCursor(m_cursor);
|
||||||
else
|
else
|
||||||
DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_ACTIVATE: {
|
case WM_ACTIVATE: {
|
||||||
|
@ -503,6 +504,19 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
processKeyUp(retranslateVirtualKey(wParam, lParam));
|
processKeyUp(retranslateVirtualKey(wParam, lParam));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case WM_SYSKEYUP:
|
||||||
|
case WM_SYSKEYDOWN: {
|
||||||
|
// F10 is the shortcut key to enter a windows menu, this is a workaround to get F10 working
|
||||||
|
if(wParam != VK_F10)
|
||||||
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
|
else {
|
||||||
|
if(uMsg == WM_SYSKEYUP)
|
||||||
|
processKeyUp(retranslateVirtualKey(wParam, lParam));
|
||||||
|
else
|
||||||
|
processKeyDown(retranslateVirtualKey(wParam, lParam));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case WM_LBUTTONDOWN: {
|
case WM_LBUTTONDOWN: {
|
||||||
SetCapture(m_window);
|
SetCapture(m_window);
|
||||||
m_inputEvent.reset(Fw::MousePressInputEvent);
|
m_inputEvent.reset(Fw::MousePressInputEvent);
|
||||||
|
|
Loading…
Reference in New Issue