mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Fixed print screen key input for all platforms.
This commit is contained in:
committed by
Camilla Berglund
parent
788bbefd8e
commit
1ae9ce1e0a
+8
-1
@@ -214,6 +214,7 @@ static int translateKey(WPARAM wParam, LPARAM lParam)
|
||||
case VK_F24: return GLFW_KEY_F24;
|
||||
case VK_NUMLOCK: return GLFW_KEY_NUM_LOCK;
|
||||
case VK_CAPITAL: return GLFW_KEY_CAPS_LOCK;
|
||||
case VK_SNAPSHOT: return GLFW_KEY_PRINT_SCREEN;
|
||||
case VK_SCROLL: return GLFW_KEY_SCROLL_LOCK;
|
||||
case VK_PAUSE: return GLFW_KEY_PAUSE;
|
||||
case VK_LWIN: return GLFW_KEY_LEFT_SUPER;
|
||||
@@ -413,12 +414,18 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
{
|
||||
// Special trick: release both shift keys on SHIFT up event
|
||||
if (wParam == VK_SHIFT)
|
||||
{
|
||||
// Special trick: release both shift keys on SHIFT up event
|
||||
_glfwInputKey(window, GLFW_KEY_LEFT_SHIFT, GLFW_RELEASE);
|
||||
_glfwInputKey(window, GLFW_KEY_RIGHT_SHIFT, GLFW_RELEASE);
|
||||
}
|
||||
else if (wParam == VK_SNAPSHOT)
|
||||
{
|
||||
// Key down is not reported for the print screen key
|
||||
_glfwInputKey(window, GLFW_KEY_PRINT_SCREEN, GLFW_PRESS);
|
||||
_glfwInputKey(window, GLFW_KEY_PRINT_SCREEN, GLFW_RELEASE);
|
||||
}
|
||||
else
|
||||
_glfwInputKey(window, translateKey(wParam, lParam), GLFW_RELEASE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user