mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Fixed print screen key input for all platforms.
This commit is contained in:
parent
788bbefd8e
commit
1ae9ce1e0a
|
@ -471,6 +471,7 @@ skills.
|
|||
* Riku Salminen
|
||||
* Sebastian Schuberth
|
||||
* Matt Sealey
|
||||
* SephiRok
|
||||
* Steve Sexton
|
||||
* Dmitri Shuralyov
|
||||
* Daniel Skorupski
|
||||
|
|
|
@ -257,7 +257,7 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||
/* 66 */ -1,
|
||||
/* 67 */ GLFW_KEY_F11,
|
||||
/* 68 */ -1,
|
||||
/* 69 */ GLFW_KEY_F13,
|
||||
/* 69 */ GLFW_KEY_PRINT_SCREEN,
|
||||
/* 6a */ GLFW_KEY_F16,
|
||||
/* 6b */ GLFW_KEY_F14,
|
||||
/* 6c */ -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);
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ static int keyCodeToGLFWKeyCode(int keyCode)
|
|||
case XK_Menu: return GLFW_KEY_MENU;
|
||||
case XK_Num_Lock: return GLFW_KEY_NUM_LOCK;
|
||||
case XK_Caps_Lock: return GLFW_KEY_CAPS_LOCK;
|
||||
case XK_Print: return GLFW_KEY_PRINT_SCREEN;
|
||||
case XK_Scroll_Lock: return GLFW_KEY_SCROLL_LOCK;
|
||||
case XK_Pause: return GLFW_KEY_PAUSE;
|
||||
case XK_Delete: return GLFW_KEY_DELETE;
|
||||
|
|
|
@ -163,6 +163,7 @@ static const char* get_key_name(int key)
|
|||
case GLFW_KEY_KP_DECIMAL: return "KEYPAD DECIMAL";
|
||||
case GLFW_KEY_KP_EQUAL: return "KEYPAD EQUAL";
|
||||
case GLFW_KEY_KP_ENTER: return "KEYPAD ENTER";
|
||||
case GLFW_KEY_PRINT_SCREEN: return "PRINT SCREEN";
|
||||
case GLFW_KEY_NUM_LOCK: return "NUM LOCK";
|
||||
case GLFW_KEY_CAPS_LOCK: return "CAPS LOCK";
|
||||
case GLFW_KEY_SCROLL_LOCK: return "SCROLL LOCK";
|
||||
|
|
Loading…
Reference in New Issue
Block a user