Package org.lwjgl.sdl

Class SDL_KeyboardEvent

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_KeyboardEvent extends Struct<SDL_KeyboardEvent> implements NativeResource

 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;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • RESERVED

      public static final int RESERVED
      The struct member offsets.
    • TIMESTAMP

      public static final int TIMESTAMP
      The struct member offsets.
    • WINDOWID

      public static final int WINDOWID
      The struct member offsets.
    • WHICH

      public static final int WHICH
      The struct member offsets.
    • SCANCODE

      public static final int SCANCODE
      The struct member offsets.
    • KEY

      public static final int KEY
      The struct member offsets.
    • MOD

      public static final int MOD
      The struct member offsets.
    • RAW

      public static final int RAW
      The struct member offsets.
    • DOWN

      public static final int DOWN
      The struct member offsets.
    • REPEAT

      public static final int REPEAT
      The struct member offsets.
  • Constructor Details

    • SDL_KeyboardEvent

      public SDL_KeyboardEvent(ByteBuffer container)
      Creates a SDL_KeyboardEvent instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SDL_KeyboardEvent>
    • type

      public int type()
      Returns:
      the value of the type field.
    • timestamp

      public long timestamp()
      Returns:
      the value of the timestamp field.
    • windowID

      public int windowID()
      Returns:
      the value of the windowID field.
    • which

      public int which()
      Returns:
      the value of the which field.
    • scancode

      public int scancode()
      Returns:
      the value of the scancode field.
    • key

      public int key()
      Returns:
      the value of the key field.
    • mod

      public short mod()
      Returns:
      the value of the mod field.
    • raw

      public short raw()
      Returns:
      the value of the raw field.
    • down

      public boolean down()
      Returns:
      the value of the down field.
    • repeat

      public boolean repeat()
      Returns:
      the value of the repeat field.
    • type

      public SDL_KeyboardEvent type(int value)
      Sets the specified value to the type field.
    • timestamp

      public SDL_KeyboardEvent timestamp(long value)
      Sets the specified value to the timestamp field.
    • windowID

      public SDL_KeyboardEvent windowID(int value)
      Sets the specified value to the windowID field.
    • which

      public SDL_KeyboardEvent which(int value)
      Sets the specified value to the which field.
    • scancode

      public SDL_KeyboardEvent scancode(int value)
      Sets the specified value to the scancode field.
    • key

      public SDL_KeyboardEvent key(int value)
      Sets the specified value to the key field.
    • mod

      public SDL_KeyboardEvent mod(short value)
      Sets the specified value to the mod field.
    • raw

      public SDL_KeyboardEvent raw(short value)
      Sets the specified value to the raw field.
    • down

      public SDL_KeyboardEvent down(boolean value)
      Sets the specified value to the down field.
    • repeat

      public SDL_KeyboardEvent repeat(boolean value)
      Sets the specified value to the repeat field.
    • set

      public SDL_KeyboardEvent set(int type, long timestamp, int windowID, int which, int scancode, int key, short mod, short raw, boolean down, boolean repeat)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static SDL_KeyboardEvent malloc()
      Returns a new SDL_KeyboardEvent instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static SDL_KeyboardEvent calloc()
      Returns a new SDL_KeyboardEvent instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static SDL_KeyboardEvent create()
      Returns a new SDL_KeyboardEvent instance allocated with BufferUtils.
    • create

      public static SDL_KeyboardEvent create(long address)
      Returns a new SDL_KeyboardEvent instance for the specified memory address.
    • createSafe

      public static @Nullable SDL_KeyboardEvent createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_KeyboardEvent.Buffer malloc(int capacity)
      Returns a new SDL_KeyboardEvent.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SDL_KeyboardEvent.Buffer calloc(int capacity)
      Returns a new SDL_KeyboardEvent.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_KeyboardEvent.Buffer create(int capacity)
      Returns a new SDL_KeyboardEvent.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_KeyboardEvent.Buffer create(long address, int capacity)
      Create a SDL_KeyboardEvent.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SDL_KeyboardEvent.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_KeyboardEvent malloc(MemoryStack stack)
      Returns a new SDL_KeyboardEvent instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static SDL_KeyboardEvent calloc(MemoryStack stack)
      Returns a new SDL_KeyboardEvent instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SDL_KeyboardEvent.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SDL_KeyboardEvent.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SDL_KeyboardEvent.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SDL_KeyboardEvent.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nreserved

      public static int nreserved(long struct)
    • ntimestamp

      public static long ntimestamp(long struct)
      Unsafe version of timestamp().
    • nwindowID

      public static int nwindowID(long struct)
      Unsafe version of windowID().
    • nwhich

      public static int nwhich(long struct)
      Unsafe version of which().
    • nscancode

      public static int nscancode(long struct)
      Unsafe version of scancode().
    • nkey

      public static int nkey(long struct)
      Unsafe version of key().
    • nmod

      public static short nmod(long struct)
      Unsafe version of mod().
    • nraw

      public static short nraw(long struct)
      Unsafe version of raw().
    • ndown

      public static boolean ndown(long struct)
      Unsafe version of down().
    • nrepeat

      public static boolean nrepeat(long struct)
      Unsafe version of repeat().
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nreserved

      public static void nreserved(long struct, int value)
    • ntimestamp

      public static void ntimestamp(long struct, long value)
      Unsafe version of timestamp.
    • nwindowID

      public static void nwindowID(long struct, int value)
      Unsafe version of windowID.
    • nwhich

      public static void nwhich(long struct, int value)
      Unsafe version of which.
    • nscancode

      public static void nscancode(long struct, int value)
      Unsafe version of scancode.
    • nkey

      public static void nkey(long struct, int value)
      Unsafe version of key.
    • nmod

      public static void nmod(long struct, short value)
      Unsafe version of mod.
    • nraw

      public static void nraw(long struct, short value)
      Unsafe version of raw.
    • ndown

      public static void ndown(long struct, boolean value)
      Unsafe version of down.
    • nrepeat

      public static void nrepeat(long struct, boolean value)
      Unsafe version of repeat.