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

@@ -223,6 +223,20 @@ ignored. This matches the behavior of the key callback, meaning the callback
arguments can always be passed unmodified to this function.
@subsection input_key_scancode Key scancodes
If you need the platform dependent scancode for any given key, you can query
it with @ref glfwGetKeyScancode.
@code
const short int scancode = glfwGetKeyScancode(GLFW_KEY_X);
set_key_mapping(scancode, swap_weapons);
@encode
If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
method will return `-1`.
@section input_mouse Mouse input
Mouse input comes in many forms, including cursor motion, button presses and

View File

@@ -5,6 +5,12 @@
@section news_33 New features in 3.3
@subsection new_33_keyscancode Platform dependent scancodes
GLFW now supports querying the platform dependent scancode of any key with
@ref glfwGetKeyScancode.
@section news_32 New features in 3.2