Top Description Inners Constructors Methods
org.lwjgl.glfw

public abstract Class GLFWKeyCallback

extends Callback
implements GLFWKeyCallbackI
Class Inheritance
All Implemented Interfaces
org.lwjgl.glfw.GLFWKeyCallbackI, org.lwjgl.system.CallbackI, org.lwjgl.system.Pointer
Known Direct Subclasses
org.lwjgl.glfw.GLFWKeyCallback.Container
Imports
javax.annotation.*, org.lwjgl.system.*

Instances of this class may be passed to the SetKeyCallback method.

Type


void (*invoke) (
    GLFWwindow *window,
    int key,
    int scancode,
    int action,
    int mods
)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
protected
pack-priv
GLFWKeyCallback(long functionPointer)

Method Summary

Modifier and TypeMethod and Description
public static GLFWKeyCallback

Returns:

the new GLFWKeyCallback
create
(long functionPointer)

Creates a GLFWKeyCallback instance from the specified function pointer.

public static GLFWKeyCallback
create(GLFWKeyCallbackI instance)

Creates a GLFWKeyCallback instance that delegates to the specified GLFWKeyCallbackI instance.

public static GLFWKeyCallback
createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

public GLFWKeyCallback
set(long window)

See SetKeyCallback.

Inherited from org.lwjgl.system.Callback:
addressequalsfreefreegetgetSafehashCodetoString

Constructor Detail

GLFWKeyCallbackback to summary
protected GLFWKeyCallback()
GLFWKeyCallbackback to summary
pack-priv GLFWKeyCallback(long functionPointer)

Method Detail

createback to summary
public static GLFWKeyCallback create(long functionPointer)

Creates a GLFWKeyCallback instance from the specified function pointer.

Returns:GLFWKeyCallback

the new GLFWKeyCallback

createback to summary
public static GLFWKeyCallback create(GLFWKeyCallbackI instance)

Creates a GLFWKeyCallback instance that delegates to the specified GLFWKeyCallbackI instance.

createSafeback to summary
public static GLFWKeyCallback createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Annotations
@Nullable
setback to summary
public GLFWKeyCallback set(long window)

See SetKeyCallback.

org.lwjgl.glfw back to summary

private final Class GLFWKeyCallback.Container

extends GLFWKeyCallback
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final GLFWKeyCallbackI

Constructor Summary

AccessConstructor and Description
pack-priv
Container(long functionPointer, GLFWKeyCallbackI delegate)

Method Summary

Modifier and TypeMethod and Description
public void
invoke(long
the window that received the event
window
,
int
the keyboard key that was pressed or released
key
,
int
the platform-specific scancode of the key
scancode
,
int
the key action. One of:
PRESSRELEASEREPEAT
action
,
int
bitfield describing which modifiers keys were held down
mods
)

Implements org.lwjgl.glfw.GLFWKeyCallbackI.invoke.

Will be called when a key is pressed, repeated or released.
Inherited from org.lwjgl.glfw.GLFWKeyCallback:
createcreatecreateSafeset

Field Detail

delegateback to summary
private final GLFWKeyCallbackI delegate

Constructor Detail

Containerback to summary
pack-priv Container(long functionPointer, GLFWKeyCallbackI delegate)

Method Detail

invokeback to summary
public void invoke(long window, int key, int scancode, int action, int mods)

Implements org.lwjgl.glfw.GLFWKeyCallbackI.invoke.

Doc from org.lwjgl.glfw.GLFWKeyCallbackI.invoke.

Will be called when a key is pressed, repeated or released.

Parameters
window:long

the window that received the event

key:int

the keyboard key that was pressed or released

scancode:int

the platform-specific scancode of the key

action:int

the key action. One of:

PRESSRELEASEREPEAT
mods:int

bitfield describing which modifiers keys were held down

Annotations
@Override