mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
@@ -1180,6 +1180,30 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
SetCursor(NULL);
|
||||
}
|
||||
|
||||
const char* _glfwPlatformGetKeyName(int key, int scancode)
|
||||
{
|
||||
WCHAR name[16];
|
||||
|
||||
if (key != GLFW_KEY_UNKNOWN)
|
||||
scancode = _glfw.win32.nativeKeys[key];
|
||||
|
||||
if (!_glfwIsPrintable(_glfw.win32.publicKeys[scancode]))
|
||||
return NULL;
|
||||
|
||||
if (!GetKeyNameTextW(scancode << 16, name, sizeof(name) / sizeof(WCHAR)))
|
||||
return NULL;
|
||||
|
||||
if (!WideCharToMultiByte(CP_UTF8, 0, name, -1,
|
||||
_glfw.win32.keyName,
|
||||
sizeof(_glfw.win32.keyName),
|
||||
NULL, NULL))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return _glfw.win32.keyName;
|
||||
}
|
||||
|
||||
int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
||||
const GLFWimage* image,
|
||||
int xhot, int yhot)
|
||||
|
||||
Reference in New Issue
Block a user