SdlKeys
final class SdlKeys
Package: dev.joid.base.lwjgl3.sdl.input · Module: base-lwjgl3-sdl · Source: SdlKeys.java
Maps the scancodes of SDL 3 to the keys of JOID and back, by physical position or through the keyboard layout.
Description
Section titled “Description”Its position table needs no SDL call, so a backend whose engine reports SDL scancodes reuses it; getKey reads the layout through SDL.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int | getCode(Key key) static | Returns the SDL scancode at the physical position of the key, or SDL_SCANCODE_UNKNOWN for a key that SDL does not name. |
Key | getKey(int code) static | Returns the key that the scancode types on the current keyboard layout, read with SDL_GetKeyFromScancode: on an AZERTY keyboard, the scancode of Q gives Key.A. |
Key | getPhysicalKey(int code) static | Returns the key at the physical position of the scancode, whatever the layout, or Key.UNKNOWN. |
boolean | isKeyDown(Key key, IntPredicate down) static | If true, the key has an SDL scancode and the predicate reports that scancode as pressed. |
Method details
Section titled “Method details”getCode
Section titled “getCode”int getCode(Key key) static
Returns the SDL scancode at the physical position of the key, or SDL_SCANCODE_UNKNOWN for a key that SDL does not name.
getKey
Section titled “getKey”Key getKey(int code) static
Returns the key that the scancode types on the current keyboard layout, read with SDL_GetKeyFromScancode: on an AZERTY keyboard, the scancode of Q gives Key.A.
getPhysicalKey
Section titled “getPhysicalKey”Key getPhysicalKey(int code) static
Returns the key at the physical position of the scancode, whatever the layout, or Key.UNKNOWN.
isKeyDown
Section titled “isKeyDown”boolean isKeyDown(Key key, IntPredicate down) static
If true, the key has an SDL scancode and the predicate reports that scancode 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
