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_GetKeyFromScancodeSDL_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_Keymod 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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfBooleanstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfShortstatic final ValueLayout.OfBooleanstatic final ValueLayout.OfIntstatic final ValueLayout.OfLongstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSDL_KeyboardEvent(@NotNull MemorySegment segment) Creates an instance of aSDL_KeyboardEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_KeyboardEventstatic SDL_KeyboardEvent.Ptrstatic SDL_KeyboardEventclone(Arena arena, SDL_KeyboardEvent src) booleandown()down(boolean value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intkey()key(int value) intmod()mod(int value) shortraw()raw(short value) booleanrepeat()repeat(boolean value) intscancode()scancode(int value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.longtimestamp(long value) final StringtoString()Returns a string representation of this record class.inttype()type(int value) intwhich()which(int value) intwindowID()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_KeyboardEventrecord class.- Parameters:
segment- the value for thesegmentrecord 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 thesegmentrecord component.
-