Class INPUT

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class INPUT extends Struct<INPUT> implements NativeResource

 struct INPUT {
     DWORD type;
     union {
         {@link MOUSEINPUT MOUSEINPUT} mi;
         {@link KEYBDINPUT KEYBDINPUT} ki;
         {@link HARDWAREINPUT HARDWAREINPUT} hi;
     } DUMMYUNIONNAME;
 }
  • 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.
    • DUMMYUNIONNAME

      public static final int DUMMYUNIONNAME
      The struct member offsets.
    • DUMMYUNIONNAME_MI

      public static final int DUMMYUNIONNAME_MI
      The struct member offsets.
    • DUMMYUNIONNAME_KI

      public static final int DUMMYUNIONNAME_KI
      The struct member offsets.
    • DUMMYUNIONNAME_HI

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

    • INPUT

      public INPUT(ByteBuffer container)
      Creates a INPUT 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<INPUT>
    • type

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

      public MOUSEINPUT DUMMYUNIONNAME_mi()
      Returns:
      a MOUSEINPUT view of the DUMMYUNIONNAME.mi field.
    • DUMMYUNIONNAME_ki

      public KEYBDINPUT DUMMYUNIONNAME_ki()
      Returns:
      a KEYBDINPUT view of the DUMMYUNIONNAME.ki field.
    • DUMMYUNIONNAME_hi

      public HARDWAREINPUT DUMMYUNIONNAME_hi()
      Returns:
      a HARDWAREINPUT view of the DUMMYUNIONNAME.hi field.
    • type

      public INPUT type(int value)
      Sets the specified value to the type field.
    • DUMMYUNIONNAME_mi

      public INPUT DUMMYUNIONNAME_mi(MOUSEINPUT value)
      Copies the specified MOUSEINPUT to the mi field.
    • DUMMYUNIONNAME_mi

      public INPUT DUMMYUNIONNAME_mi(Consumer<MOUSEINPUT> consumer)
      Passes the mi field to the specified Consumer.
    • DUMMYUNIONNAME_ki

      public INPUT DUMMYUNIONNAME_ki(KEYBDINPUT value)
      Copies the specified KEYBDINPUT to the ki field.
    • DUMMYUNIONNAME_ki

      public INPUT DUMMYUNIONNAME_ki(Consumer<KEYBDINPUT> consumer)
      Passes the ki field to the specified Consumer.
    • DUMMYUNIONNAME_hi

      public INPUT DUMMYUNIONNAME_hi(HARDWAREINPUT value)
      Copies the specified HARDWAREINPUT to the hi field.
    • DUMMYUNIONNAME_hi

      public INPUT DUMMYUNIONNAME_hi(Consumer<HARDWAREINPUT> consumer)
      Passes the hi field to the specified Consumer.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static INPUT.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new INPUT.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().
    • nDUMMYUNIONNAME_mi

      public static MOUSEINPUT nDUMMYUNIONNAME_mi(long struct)
      Unsafe version of DUMMYUNIONNAME_mi().
    • nDUMMYUNIONNAME_ki

      public static KEYBDINPUT nDUMMYUNIONNAME_ki(long struct)
      Unsafe version of DUMMYUNIONNAME_ki().
    • nDUMMYUNIONNAME_hi

      public static HARDWAREINPUT nDUMMYUNIONNAME_hi(long struct)
      Unsafe version of DUMMYUNIONNAME_hi().
    • ntype

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

      public static void nDUMMYUNIONNAME_mi(long struct, MOUSEINPUT value)
      Unsafe version of DUMMYUNIONNAME_mi.
    • nDUMMYUNIONNAME_ki

      public static void nDUMMYUNIONNAME_ki(long struct, KEYBDINPUT value)
      Unsafe version of DUMMYUNIONNAME_ki.
    • nDUMMYUNIONNAME_hi

      public static void nDUMMYUNIONNAME_hi(long struct, HARDWAREINPUT value)
      Unsafe version of DUMMYUNIONNAME_hi.