Skip to content

Lwjgl2Keys

final class Lwjgl2Keys
Package: dev.joid.base.lwjgl2.input · Module: base-lwjgl2 · Source: Lwjgl2Keys.java
Backends: LWJGL 2

Maps the key codes of LWJGL 2 to the keys of JOID and back, by physical position or through the character that the key typed.

LWJGL 2 does not tell the layout, so the key of the layout comes from the character of each press, remembered for the presses with a modifier.

ReturnsSignatureSummary
intgetCode(Key key) staticReturns the LWJGL 2 code at the physical position of the key, or Keyboard.KEY_NONE for a key that LWJGL 2 does not name.
KeygetPhysicalKey(int code) staticReturns the key at the physical position of the LWJGL 2 code, or Key.UNKNOWN.
KeygetKey(int code, char character) staticReturns the key that the press typed on the current layout: the key of the character for a letter or symbol key, the key of the position for the others.
booleanisKeyDown(Key key) staticIf true, LWJGL 2 reports the key at that physical position as pressed.

int getCode(Key key) static

Returns the LWJGL 2 code at the physical position of the key, or Keyboard.KEY_NONE for a key that LWJGL 2 does not name.

Key getPhysicalKey(int code) static

Returns the key at the physical position of the LWJGL 2 code, or Key.UNKNOWN.

Key getKey(int code, char character) static

Returns the key that the press typed on the current layout: the key of the character for a letter or symbol key, the key of the position for the others. With Control, a letter types a control character, which gives its letter. With Shift or Alt held, or Control on another key, it returns the key that this position typed last without a modifier.

boolean isKeyDown(Key key) static

If true, LWJGL 2 reports the key at that physical position 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