mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Add glfwGetKeyScancode
Allows retrieval of platform scancode from GLFW_KEY_*. Implemented for Win32, Cocoa and X11. Stubs for Mir and Wayland. Closes #830.
This commit is contained in:
committed by
Camilla Berglund
parent
f17d60da64
commit
e745b0dd47
@@ -1511,6 +1511,16 @@ const char* _glfwPlatformGetKeyName(int key, int scancode)
|
||||
return _glfw.ns.keyName;
|
||||
}
|
||||
|
||||
const short int _glfwPlatformGetKeyScancode(int key)
|
||||
{
|
||||
if(key <= -1 || key >= (sizeof(_glfw.ns.nativeKeys) / sizeof(_glfw.ns.nativeKeys[0])))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return _glfw.ns.nativeKeys[key];
|
||||
}
|
||||
|
||||
int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
||||
const GLFWimage* image,
|
||||
int xhot, int yhot)
|
||||
|
||||
Reference in New Issue
Block a user