GlfwKeys
final class GlfwKeys
Package: dev.joid.base.lwjgl3.glfw.input · Module: base-lwjgl3-glfw · Source: GlfwKeys.java
Backends: LWJGL 3 Vulkan
Maps the key codes of GLFW to the keys of JOID and back, by physical position or through the keyboard layout.
Description
Section titled “Description”Its position table needs no GLFW call, so a backend whose engine reports GLFW key codes reuses it; getKey reads the layout through GLFW.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int | getCode(Key key) static | Returns the GLFW key code at the physical position of the key, or GLFW_KEY_UNKNOWN for a key that GLFW does not name. |
Key | getKey(int code) static | Returns the key that the code types on the current keyboard layout, read with glfwGetKeyName: on an AZERTY keyboard, the code of Q gives Key.A. |
Key | getPhysicalKey(int code) static | Returns the key at the physical position of the code, whatever the layout, or Key.UNKNOWN. |
boolean | isKeyDown(Key key, IntPredicate down) static | If true, the key has a GLFW code and the predicate reports that code as pressed. |
Method details
Section titled “Method details”getCode
Section titled “getCode”int getCode(Key key) static
Returns the GLFW key code at the physical position of the key, or GLFW_KEY_UNKNOWN for a key that GLFW does not name.
getKey
Section titled “getKey”Key getKey(int code) static
Returns the key that the code types on the current keyboard layout, read with glfwGetKeyName: on an AZERTY keyboard, the code of Q gives Key.A.
getPhysicalKey
Section titled “getPhysicalKey”Key getPhysicalKey(int code) static
Returns the key at the physical position of the code, whatever the layout, or Key.UNKNOWN.
isKeyDown
Section titled “isKeyDown”boolean isKeyDown(Key key, IntPredicate down) static
If true, the key has a GLFW code and the predicate reports that code as pressed.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
