Skip to content

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.

Its position table needs no GLFW call, so a backend whose engine reports GLFW key codes reuses it; getKey reads the layout through GLFW.

ReturnsSignatureSummary
intgetCode(Key key) staticReturns the GLFW key code at the physical position of the key, or GLFW_KEY_UNKNOWN for a key that GLFW does not name.
KeygetKey(int code) staticReturns 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.
KeygetPhysicalKey(int code) staticReturns the key at the physical position of the code, whatever the layout, or Key.UNKNOWN.
booleanisKeyDown(Key key, IntPredicate down) staticIf true, the key has a GLFW code and the predicate reports that code as pressed.

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.


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

Report a problem with this page