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:
Michael Stocker
2016-08-11 19:11:40 +02:00
committed by Camilla Berglund
parent f17d60da64
commit e745b0dd47
11 changed files with 101 additions and 0 deletions

View File

@@ -3003,6 +3003,30 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
*/
GLFWAPI const char* glfwGetKeyName(int key, int scancode);
/*! @brief Returns the platform dependent scancode of the specified key.
*
* This function returns the platform dependent scancode of the specified key.
* This is intended for platform specific default keybindings.
*
* If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
* method will return `-1`.
*
* @param[in] key The key to query.
* @return The platform dependent scancode for the key, or `-1`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @thread_safety This function may be called from any thread.
*
* @sa @ref input_key_scancode
*
* @since Added in version 3.3.
*
* @ingroup input
*/
GLFWAPI const short int glfwGetKeyScancode(int key);
/*! @brief Returns the last reported state of a keyboard key for the specified
* window.
*