Record Class SDL_KeyboardEvent
- All Implemented Interfaces:
IPointer
,ISDL_KeyboardEvent
Keyboard button event structure (event.key.*)
The key
is the base SDL_Keycode generated by pressing the scancode
using the current keyboard layout, applying any options specified in
SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the
event scancode and modifiers directly from the keyboard layout, bypassing
SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode().
Since: This struct is available since SDL 3.2.0.
See also:
SDL_GetKeyFromScancode
SDL_HINT_KEYCODE_OPTIONS
Structure
typedef struct SDL_KeyboardEvent {
SDL_EventType
type
;
Uint32 reserved;
Uint64 timestamp
;
SDL_WindowID windowID
;
SDL_KeyboardID which
;
SDL_Scancode
scancode
;
SDL_Keycode
key
;
SDL_Key
mod
mod
;
Uint16 raw
;
bool down
;
bool repeat
;
} SDL_KeyboardEvent;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfBoolean
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfShort
static final ValueLayout.OfBoolean
static final ValueLayout.OfInt
static final ValueLayout.OfLong
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_KeyboardEvent
(@NotNull MemorySegment segment) Creates an instance of aSDL_KeyboardEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_KeyboardEvent
static SDL_KeyboardEvent.Ptr
static SDL_KeyboardEvent
clone
(Arena arena, SDL_KeyboardEvent src) boolean
down()
down
(boolean value) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
key()
key
(int value) int
mod()
mod
(int value) short
raw()
raw
(short value) boolean
repeat()
repeat
(boolean value) int
scancode()
scancode
(int value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.long
timestamp
(long value) final String
toString()
Returns a string representation of this record class.int
type()
type
(int value) int
which()
which
(int value) int
windowID()
windowID
(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$type
-
PATH$timestamp
-
PATH$windowID
-
PATH$which
-
PATH$scancode
-
PATH$key
-
PATH$mod
-
PATH$raw
-
PATH$down
-
PATH$repeat
-
LAYOUT$type
-
LAYOUT$timestamp
-
LAYOUT$windowID
-
LAYOUT$which
-
LAYOUT$scancode
-
LAYOUT$key
-
LAYOUT$mod
-
LAYOUT$raw
-
LAYOUT$down
-
LAYOUT$repeat
-
SIZE$type
public static final long SIZE$type -
SIZE$timestamp
public static final long SIZE$timestamp -
SIZE$windowID
public static final long SIZE$windowID -
SIZE$which
public static final long SIZE$which -
SIZE$scancode
public static final long SIZE$scancode -
SIZE$key
public static final long SIZE$key -
SIZE$mod
public static final long SIZE$mod -
SIZE$raw
public static final long SIZE$raw -
SIZE$down
public static final long SIZE$down -
SIZE$repeat
public static final long SIZE$repeat -
OFFSET$type
public static final long OFFSET$type -
OFFSET$timestamp
public static final long OFFSET$timestamp -
OFFSET$windowID
public static final long OFFSET$windowID -
OFFSET$which
public static final long OFFSET$which -
OFFSET$scancode
public static final long OFFSET$scancode -
OFFSET$key
public static final long OFFSET$key -
OFFSET$mod
public static final long OFFSET$mod -
OFFSET$raw
public static final long OFFSET$raw -
OFFSET$down
public static final long OFFSET$down -
OFFSET$repeat
public static final long OFFSET$repeat
-
-
Constructor Details
-
SDL_KeyboardEvent
Creates an instance of aSDL_KeyboardEvent
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
type
-
type
-
timestamp
-
timestamp
-
windowID
-
windowID
-
which
-
which
-
scancode
-
scancode
-
key
-
key
-
mod
-
mod
-
raw
-
raw
-
down
-
down
-
repeat
-
repeat
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-