Class KEYBDINPUT

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class KEYBDINPUT
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Contains information about a simulated keyboard event.

    Layout

    
     struct KEYBDINPUT {
         WORD wVk();
         WORD wScan();
         DWORD dwFlags();
         DWORD time();
         ULONG_PTR dwExtraInfo();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  KEYBDINPUT.Buffer
      An array of KEYBDINPUT structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

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

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int DWEXTRAINFO
      DWFLAGS
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int TIME
      WSCAN
      WVK
      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
      KEYBDINPUT​(java.nio.ByteBuffer container)
      Creates a KEYBDINPUT instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • WVK, WSCAN, DWFLAGS, TIME, DWEXTRAINFO

        The struct member offsets.
    • Constructor Detail

      • KEYBDINPUT

        public KEYBDINPUT​(java.nio.ByteBuffer container)
        Creates a KEYBDINPUT 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • wVk

        public short wVk()
        A virtual-key code.

        The code must be a value in the range 1 to 254. If the dwFlags member specifies User32.KEYEVENTF_UNICODE, wVk must be 0.

      • wScan

        public short wScan()
        A hardware scan code for the key.

        If dwFlags specifies User32.KEYEVENTF_UNICODE, wScan specifies a Unicode character which is to be sent to the foreground application.

      • time

        public int time()
        the time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.
      • dwExtraInfo

        public long dwExtraInfo()
        an additional value associated with the keystroke. Use the User32.GetMessageExtraInfo() function to obtain this information.
      • wVk

        public KEYBDINPUT wVk​(short value)
        Sets the specified value to the wVk() field.
      • wScan

        public KEYBDINPUT wScan​(short value)
        Sets the specified value to the wScan() field.
      • dwFlags

        public KEYBDINPUT dwFlags​(int value)
        Sets the specified value to the dwFlags() field.
      • time

        public KEYBDINPUT time​(int value)
        Sets the specified value to the time() field.
      • set

        public KEYBDINPUT set​(short wVk,
                              short wScan,
                              int dwFlags,
                              int time,
                              long dwExtraInfo)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

        @Deprecated
        public static KEYBDINPUT.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 KEYBDINPUT.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 KEYBDINPUT malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new KEYBDINPUT instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

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

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

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

        public static short nwVk​(long struct)
        Unsafe version of wVk().
      • nwScan

        public static short nwScan​(long struct)
        Unsafe version of wScan().
      • ndwFlags

        public static int ndwFlags​(long struct)
        Unsafe version of dwFlags().
      • ntime

        public static int ntime​(long struct)
        Unsafe version of time().
      • ndwExtraInfo

        public static long ndwExtraInfo​(long struct)
        Unsafe version of dwExtraInfo().
      • nwVk

        public static void nwVk​(long struct,
                                short value)
        Unsafe version of wVk.
      • nwScan

        public static void nwScan​(long struct,
                                  short value)
        Unsafe version of wScan.
      • ndwFlags

        public static void ndwFlags​(long struct,
                                    int value)
        Unsafe version of dwFlags.
      • ntime

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

        public static void ndwExtraInfo​(long struct,
                                        long value)
        Unsafe version of dwExtraInfo.