mirror of
https://github.com/glfw/glfw.git
synced 2026-08-29 03:04:14 +02: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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user