Class TOUCHINPUT

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

    public class TOUCHINPUT
    extends Struct
    implements NativeResource
    Encapsulates data for touch input.

    Member documentation

    • x – the x-coordinate (horizontal point) of the touch input. This member is indicated in hundredths of a pixel of physical screen coordinates.
    • y – the y-coordinate (vertical point) of the touch input. This member is indicated in hundredths of a pixel of physical screen coordinates.
    • hSource – a device handle for the source input device. Each device is given a unique provider at run time by the touch input provider.
    • dwID – a touch point identifier that distinguishes a particular touch input. This value stays consistent in a touch contact sequence from the point a contact comes down until it comes back up. An ID may be reused later for subsequent contacts.
    • dwFlags – a set of bit flags that specify various aspects of touch point press, release, and motion. The bits in this member can be any reasonable combination of the values in the Remarks section.
    • dwMask – a set of bit flags that specify which of the optional fields in the structure contain valid values. The availability of valid information in the optional fields is device-specific. Applications should use an optional field value only when the corresponding bit is set in dwMask. This field may contain a combination of the dwMask flags mentioned in the Remarks section.
    • dwTime – the time stamp for the event, in milliseconds. The consuming application should note that the system performs no validation on this field; when the User32.TOUCHINPUTMASKF_TIMEFROMSYSTEM flag is not set, the accuracy and sequencing of values in this field are completely dependent on the touch input provider.
    • dwExtraInfo – an additional value associated with the touch event.
    • cxContact – the width of the touch contact area in hundredths of a pixel in physical screen coordinates. This value is only valid if the dwMask member has the User32.TOUCHINPUTMASKF_CONTACTAREA flag set.
    • cyContact – the height of the touch contact area in hundredths of a pixel in physical screen coordinates. This value is only valid if the dwMask member has the User32.TOUCHINPUTMASKF_CONTACTAREA flag set.

    Layout

    
     struct TOUCHINPUT {
         LONG x;
         LONG y;
         HANDLE hSource;
         DWORD dwID;
         DWORD dwFlags;
         DWORD dwMask;
         DWORD dwTime;
         ULONG_PTR dwExtraInfo;
         DWORD cxContact;
         DWORD cyContact;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • X, Y, HSOURCE, DWID, DWFLAGS, DWMASK, DWTIME, DWEXTRAINFO, CXCONTACT, CYCONTACT

        The struct member offsets.
    • Constructor Detail

      • TOUCHINPUT

        public TOUCHINPUT​(java.nio.ByteBuffer container)
        Creates a TOUCHINPUT 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • x

        public int x()
        Returns the value of the x field.
      • y

        public int y()
        Returns the value of the y field.
      • hSource

        public long hSource()
        Returns the value of the hSource field.
      • dwID

        public int dwID()
        Returns the value of the dwID field.
      • dwFlags

        public int dwFlags()
        Returns the value of the dwFlags field.
      • dwMask

        public int dwMask()
        Returns the value of the dwMask field.
      • dwTime

        public int dwTime()
        Returns the value of the dwTime field.
      • dwExtraInfo

        public long dwExtraInfo()
        Returns the value of the dwExtraInfo field.
      • cxContact

        public int cxContact()
        Returns the value of the cxContact field.
      • cyContact

        public int cyContact()
        Returns the value of the cyContact field.
      • malloc

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

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

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

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

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

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

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

        public static TOUCHINPUT callocStack()
        Returns a new TOUCHINPUT instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

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

        public static TOUCHINPUT.Buffer callocStack​(int capacity)
        Returns a new TOUCHINPUT.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static TOUCHINPUT.Buffer callocStack​(int capacity,
                                                    MemoryStack stack)
        Returns a new TOUCHINPUT.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
      • nx

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

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

        public static long nhSource​(long struct)
        Unsafe version of hSource().
      • ndwID

        public static int ndwID​(long struct)
        Unsafe version of dwID().
      • ndwFlags

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

        public static int ndwMask​(long struct)
        Unsafe version of dwMask().
      • ndwTime

        public static int ndwTime​(long struct)
        Unsafe version of dwTime().
      • ndwExtraInfo

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

        public static int ncxContact​(long struct)
        Unsafe version of cxContact().
      • ncyContact

        public static int ncyContact​(long struct)
        Unsafe version of cyContact().