Class XKeyEvent

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<XKeyEvent>
org.lwjgl.system.linux.XKeyEvent
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class XKeyEvent extends org.lwjgl.system.Struct<XKeyEvent> implements org.lwjgl.system.NativeResource
Key event.

Layout


 struct XKeyEvent {
     int type();
     unsigned long serial();
     Bool send_event();
     Display * display();
     Window window();
     Window root();
     Window subwindow();
     Time time();
     int x();
     int y();
     int x_root();
     int y_root();
     unsigned int state();
     unsigned int keycode();
     Bool same_screen();
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of XKeyEvent structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    XKeyEvent(ByteBuffer container)
    Creates a XKeyEvent instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    static XKeyEvent
    Returns a new XKeyEvent instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new XKeyEvent.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new XKeyEvent.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static XKeyEvent
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new XKeyEvent instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static XKeyEvent
    Deprecated.
    callocStack(int capacity)
    Deprecated.
    callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static XKeyEvent
    callocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static XKeyEvent
    Returns a new XKeyEvent instance allocated with BufferUtils.
    create(int capacity)
    Returns a new XKeyEvent.Buffer instance allocated with BufferUtils.
    static XKeyEvent
    create(long address)
    Returns a new XKeyEvent instance for the specified memory address.
    create(long address, int capacity)
    Create a XKeyEvent.Buffer instance at the specified memory.
    static XKeyEvent
    createSafe(long address)
    Like create, but returns null if address is NULL.
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    long
    Display the event was read from
    display(long value)
    Sets the specified value to the display() field.
    int
    detail
    keycode(int value)
    Sets the specified value to the keycode() field.
    static XKeyEvent
    Returns a new XKeyEvent instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new XKeyEvent.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new XKeyEvent.Buffer instance allocated on the specified MemoryStack.
    static XKeyEvent
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new XKeyEvent instance allocated on the specified MemoryStack.
    static XKeyEvent
    Deprecated.
    mallocStack(int capacity)
    Deprecated.
    mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static XKeyEvent
    mallocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static long
    ndisplay(long struct)
    Unsafe version of display().
    static void
    ndisplay(long struct, long value)
    Unsafe version of display.
    static int
    nkeycode(long struct)
    Unsafe version of keycode().
    static void
    nkeycode(long struct, int value)
    Unsafe version of keycode.
    static long
    nroot(long struct)
    Unsafe version of root().
    static void
    nroot(long struct, long value)
    Unsafe version of root.
    static int
    nsame_screen(long struct)
    Unsafe version of same_screen().
    static void
    nsame_screen(long struct, int value)
    Unsafe version of same_screen.
    static int
    nsend_event(long struct)
    Unsafe version of send_event().
    static void
    nsend_event(long struct, int value)
    Unsafe version of send_event.
    static long
    nserial(long struct)
    Unsafe version of serial().
    static void
    nserial(long struct, long value)
    Unsafe version of serial.
    static int
    nstate(long struct)
    Unsafe version of state().
    static void
    nstate(long struct, int value)
    Unsafe version of state.
    static long
    nsubwindow(long struct)
    Unsafe version of subwindow().
    static void
    nsubwindow(long struct, long value)
    Unsafe version of subwindow.
    static long
    ntime(long struct)
    Unsafe version of time().
    static void
    ntime(long struct, long value)
    Unsafe version of time.
    static int
    ntype(long struct)
    Unsafe version of type().
    static void
    ntype(long struct, int value)
    Unsafe version of type.
    static long
    nwindow(long struct)
    Unsafe version of window().
    static void
    nwindow(long struct, long value)
    Unsafe version of window.
    static int
    nx(long struct)
    Unsafe version of x().
    static void
    nx(long struct, int value)
    Unsafe version of x.
    static int
    nx_root(long struct)
    Unsafe version of x_root().
    static void
    nx_root(long struct, int value)
    Unsafe version of x_root.
    static int
    ny(long struct)
    Unsafe version of y().
    static void
    ny(long struct, int value)
    Unsafe version of y.
    static int
    ny_root(long struct)
    Unsafe version of y_root().
    static void
    ny_root(long struct, int value)
    Unsafe version of y_root.
    long
    root window that the event occurred on
    root(long value)
    Sets the specified value to the root() field.
    boolean
    same screen flag
    same_screen(boolean value)
    Sets the specified value to the same_screen() field.
    boolean
    send_event(boolean value)
    Sets the specified value to the send_event() field.
    long
    # of last request processed by server
    serial(long value)
    Sets the specified value to the serial() field.
    set(int type, long serial, boolean send_event, long display, long window, long root, long subwindow, long time, int x, int y, int x_root, int y_root, int state, int keycode, boolean same_screen)
    Initializes this struct with the specified values.
    Copies the specified struct data to this struct.
    int
     
    int
    key mask
    state(int value)
    Sets the specified value to the state() field.
    long
    child window
    subwindow(long value)
    Sets the specified value to the subwindow() field.
    long
    milliseconds
    time(long value)
    Sets the specified value to the time() field.
    int
    the event type.
    type(int value)
    Sets the specified value to the type() field.
    static void
    validate(long struct)
    Validates pointer members that should not be NULL.
    long
    window it reported relative to
    window(long value)
    Sets the specified value to the window() field.
    int
    x()
    pointer x coordinate in event window
    x(int value)
    Sets the specified value to the x() field.
    int
    x coordinate relative to root
    x_root(int value)
    Sets the specified value to the x_root() field.
    int
    y()
    pointer y coordinate in event window
    y(int value)
    Sets the specified value to the y() field.
    int
    y coordinate relative to root
    y_root(int value)
    Sets the specified value to the y_root() field.

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • 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.
    • SERIAL

      public static final int SERIAL
      The struct member offsets.
    • SEND_EVENT

      public static final int SEND_EVENT
      The struct member offsets.
    • DISPLAY

      public static final int DISPLAY
      The struct member offsets.
    • WINDOW

      public static final int WINDOW
      The struct member offsets.
    • ROOT

      public static final int ROOT
      The struct member offsets.
    • SUBWINDOW

      public static final int SUBWINDOW
      The struct member offsets.
    • TIME

      public static final int TIME
      The struct member offsets.
    • X

      public static final int X
      The struct member offsets.
    • Y

      public static final int Y
      The struct member offsets.
    • X_ROOT

      public static final int X_ROOT
      The struct member offsets.
    • Y_ROOT

      public static final int Y_ROOT
      The struct member offsets.
    • STATE

      public static final int STATE
      The struct member offsets.
    • KEYCODE

      public static final int KEYCODE
      The struct member offsets.
    • SAME_SCREEN

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

    • XKeyEvent

      public XKeyEvent(ByteBuffer container)
      Creates a XKeyEvent 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()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XKeyEvent>
    • type

      public int type()
      the event type. One of:
      X11.KeyPressX11.KeyRelease
    • serial

      public long serial()
      # of last request processed by server
    • send_event

      public boolean send_event()
    • display

      public long display()
      Display the event was read from
    • window

      public long window()
      window it reported relative to
    • root

      public long root()
      root window that the event occurred on
    • subwindow

      public long subwindow()
      child window
    • time

      public long time()
      milliseconds
    • x

      public int x()
      pointer x coordinate in event window
    • y

      public int y()
      pointer y coordinate in event window
    • x_root

      public int x_root()
      x coordinate relative to root
    • y_root

      public int y_root()
      y coordinate relative to root
    • state

      public int state()
      key mask
    • keycode

      public int keycode()
      detail
    • same_screen

      public boolean same_screen()
      same screen flag
    • type

      public XKeyEvent type(int value)
      Sets the specified value to the type() field.
    • serial

      public XKeyEvent serial(long value)
      Sets the specified value to the serial() field.
    • send_event

      public XKeyEvent send_event(boolean value)
      Sets the specified value to the send_event() field.
    • display

      public XKeyEvent display(long value)
      Sets the specified value to the display() field.
    • window

      public XKeyEvent window(long value)
      Sets the specified value to the window() field.
    • root

      public XKeyEvent root(long value)
      Sets the specified value to the root() field.
    • subwindow

      public XKeyEvent subwindow(long value)
      Sets the specified value to the subwindow() field.
    • time

      public XKeyEvent time(long value)
      Sets the specified value to the time() field.
    • x

      public XKeyEvent x(int value)
      Sets the specified value to the x() field.
    • y

      public XKeyEvent y(int value)
      Sets the specified value to the y() field.
    • x_root

      public XKeyEvent x_root(int value)
      Sets the specified value to the x_root() field.
    • y_root

      public XKeyEvent y_root(int value)
      Sets the specified value to the y_root() field.
    • state

      public XKeyEvent state(int value)
      Sets the specified value to the state() field.
    • keycode

      public XKeyEvent keycode(int value)
      Sets the specified value to the keycode() field.
    • same_screen

      public XKeyEvent same_screen(boolean value)
      Sets the specified value to the same_screen() field.
    • set

      public XKeyEvent set(int type, long serial, boolean send_event, long display, long window, long root, long subwindow, long time, int x, int y, int x_root, int y_root, int state, int keycode, boolean same_screen)
      Initializes this struct with the specified values.
    • set

      public XKeyEvent set(XKeyEvent src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static XKeyEvent mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static XKeyEvent callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static XKeyEvent mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static XKeyEvent callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static XKeyEvent.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static XKeyEvent.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static XKeyEvent.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static XKeyEvent.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

      public static XKeyEvent.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XKeyEvent.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().
    • nserial

      public static long nserial(long struct)
      Unsafe version of serial().
    • nsend_event

      public static int nsend_event(long struct)
      Unsafe version of send_event().
    • ndisplay

      public static long ndisplay(long struct)
      Unsafe version of display().
    • nwindow

      public static long nwindow(long struct)
      Unsafe version of window().
    • nroot

      public static long nroot(long struct)
      Unsafe version of root().
    • nsubwindow

      public static long nsubwindow(long struct)
      Unsafe version of subwindow().
    • ntime

      public static long ntime(long struct)
      Unsafe version of time().
    • nx

      public static int nx(long struct)
      Unsafe version of x().
    • ny

      public static int ny(long struct)
      Unsafe version of y().
    • nx_root

      public static int nx_root(long struct)
      Unsafe version of x_root().
    • ny_root

      public static int ny_root(long struct)
      Unsafe version of y_root().
    • nstate

      public static int nstate(long struct)
      Unsafe version of state().
    • nkeycode

      public static int nkeycode(long struct)
      Unsafe version of keycode().
    • nsame_screen

      public static int nsame_screen(long struct)
      Unsafe version of same_screen().
    • ntype

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

      public static void nserial(long struct, long value)
      Unsafe version of serial.
    • nsend_event

      public static void nsend_event(long struct, int value)
      Unsafe version of send_event.
    • ndisplay

      public static void ndisplay(long struct, long value)
      Unsafe version of display.
    • nwindow

      public static void nwindow(long struct, long value)
      Unsafe version of window.
    • nroot

      public static void nroot(long struct, long value)
      Unsafe version of root.
    • nsubwindow

      public static void nsubwindow(long struct, long value)
      Unsafe version of subwindow.
    • ntime

      public static void ntime(long struct, long value)
      Unsafe version of time.
    • nx

      public static void nx(long struct, int value)
      Unsafe version of x.
    • ny

      public static void ny(long struct, int value)
      Unsafe version of y.
    • nx_root

      public static void nx_root(long struct, int value)
      Unsafe version of x_root.
    • ny_root

      public static void ny_root(long struct, int value)
      Unsafe version of y_root.
    • nstate

      public static void nstate(long struct, int value)
      Unsafe version of state.
    • nkeycode

      public static void nkeycode(long struct, int value)
      Unsafe version of keycode.
    • nsame_screen

      public static void nsame_screen(long struct, int value)
      Unsafe version of same_screen.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate