Class MOUSEINPUT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.windows.MOUSEINPUT
-
- All Implemented Interfaces:
java.lang.AutoCloseable,NativeResource,Pointer
public class MOUSEINPUT extends Struct implements NativeResource
Contains information about a simulated mouse event.Member documentation
dx– the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlagsmember.Absolute data is specified as the x coordinate of the mouse; relative data is specified as the number of pixels moved.
dy– the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlagsmember.Absolute data is specified as the y coordinate of the mouse; relative data is specified as the number of pixels moved.
mouseData– IfdwFlagscontainsUser32.MOUSEEVENTF_WHEEL, thenmouseDataspecifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined asUser32.WHEEL_DELTA, which is 120.Windows Vista: If
dwFlagscontainsUser32.MOUSEEVENTF_HWHEEL, thendwDataspecifies the amount of wheel movement. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left. One wheel click is defined asWHEEL_DELTA, which is 120.If
dwFlagsdoes not containUser32.MOUSEEVENTF_WHEEL,User32.MOUSEEVENTF_XDOWN, orUser32.MOUSEEVENTF_XUP, thenmouseDatashould be zero.If
dwFlagscontainsUser32.MOUSEEVENTF_XDOWNorUser32.MOUSEEVENTF_XUP, thenmouseDataspecifies which X buttons were pressed or released. This value may be any combination of the following flags:User32.XBUTTON1,User32.XBUTTON2. One of:User32.XBUTTON1User32.XBUTTON2dwFlags– A set of bit flags that specify various aspects of mouse motion and button clicks.The bit flags that specify mouse button status are set to indicate changes in status, not ongoing conditions. For example, if the left mouse button is pressed and held down,
User32.MOUSEEVENTF_LEFTDOWNis set when the left button is first pressed, but not for subsequent motions. Similarly,User32.MOUSEEVENTF_LEFTUPis set only when the button is first released.You cannot specify both the
User32.MOUSEEVENTF_WHEELflag and eitherUser32.MOUSEEVENTF_XDOWNorUser32.MOUSEEVENTF_XUPflags simultaneously in thedwFlagsparameter, because they both require use of themouseDatafield. One of:time– the time stamp for the event, in milliseconds. If this parameter is 0, the system will provide its own time stamp.dwExtraInfo– an additional value associated with the mouse event. An application callsUser32.GetMessageExtraInfo()to obtain this extra information.
Layout
struct MOUSEINPUT { LONG dx; LONG dy; DWORD mouseData; DWORD dwFlags; DWORD time; ULONG_PTR dwExtraInfo; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMOUSEINPUT.BufferAn array ofMOUSEINPUTstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intDWEXTRAINFO
DWFLAGS
DX
DY
MOUSEDATAThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTIMEThe 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 MOUSEINPUT(java.nio.ByteBuffer container)Creates aMOUSEINPUTinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MOUSEINPUTcalloc()Returns a newMOUSEINPUTinstance allocated withmemCalloc.static MOUSEINPUT.Buffercalloc(int capacity)Returns a newMOUSEINPUT.Bufferinstance allocated withmemCalloc.static MOUSEINPUTcallocStack()Returns a newMOUSEINPUTinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static MOUSEINPUT.BuffercallocStack(int capacity)Returns a newMOUSEINPUT.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static MOUSEINPUT.BuffercallocStack(int capacity, MemoryStack stack)Returns a newMOUSEINPUT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MOUSEINPUTcallocStack(MemoryStack stack)Returns a newMOUSEINPUTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MOUSEINPUTcreate()Returns a newMOUSEINPUTinstance allocated withBufferUtils.static MOUSEINPUT.Buffercreate(int capacity)Returns a newMOUSEINPUT.Bufferinstance allocated withBufferUtils.static MOUSEINPUTcreate(long address)Returns a newMOUSEINPUTinstance for the specified memory address.static MOUSEINPUT.Buffercreate(long address, int capacity)Create aMOUSEINPUT.Bufferinstance at the specified memory.static MOUSEINPUTcreateSafe(long address)static MOUSEINPUT.BuffercreateSafe(long address, int capacity)longdwExtraInfo()Returns the value of thedwExtraInfofield.MOUSEINPUTdwExtraInfo(long value)Sets the specified value to thedwExtraInfofield.intdwFlags()Returns the value of thedwFlagsfield.MOUSEINPUTdwFlags(int value)Sets the specified value to thedwFlagsfield.intdx()Returns the value of thedxfield.MOUSEINPUTdx(int value)Sets the specified value to thedxfield.intdy()Returns the value of thedyfield.MOUSEINPUTdy(int value)Sets the specified value to thedyfield.static MOUSEINPUTmalloc()Returns a newMOUSEINPUTinstance allocated withmemAlloc.static MOUSEINPUT.Buffermalloc(int capacity)Returns a newMOUSEINPUT.Bufferinstance allocated withmemAlloc.static MOUSEINPUTmallocStack()Returns a newMOUSEINPUTinstance allocated on the thread-localMemoryStack.static MOUSEINPUT.BuffermallocStack(int capacity)Returns a newMOUSEINPUT.Bufferinstance allocated on the thread-localMemoryStack.static MOUSEINPUT.BuffermallocStack(int capacity, MemoryStack stack)Returns a newMOUSEINPUT.Bufferinstance allocated on the specifiedMemoryStack.static MOUSEINPUTmallocStack(MemoryStack stack)Returns a newMOUSEINPUTinstance allocated on the specifiedMemoryStack.intmouseData()Returns the value of themouseDatafield.MOUSEINPUTmouseData(int value)Sets the specified value to themouseDatafield.static longndwExtraInfo(long struct)Unsafe version ofdwExtraInfo().static voidndwExtraInfo(long struct, long value)Unsafe version ofdwExtraInfo.static intndwFlags(long struct)Unsafe version ofdwFlags().static voidndwFlags(long struct, int value)Unsafe version ofdwFlags.static intndx(long struct)Unsafe version ofdx().static voidndx(long struct, int value)Unsafe version ofdx.static intndy(long struct)Unsafe version ofdy().static voidndy(long struct, int value)Unsafe version ofdy.static intnmouseData(long struct)Unsafe version ofmouseData().static voidnmouseData(long struct, int value)Unsafe version ofmouseData.static intntime(long struct)Unsafe version oftime().static voidntime(long struct, int value)Unsafe version oftime.MOUSEINPUTset(int dx, int dy, int mouseData, int dwFlags, int time, long dwExtraInfo)Initializes this struct with the specified values.MOUSEINPUTset(MOUSEINPUT src)Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).inttime()Returns the value of thetimefield.MOUSEINPUTtime(int value)Sets the specified value to thetimefield.-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
-
-
-
Constructor Detail
-
MOUSEINPUT
public MOUSEINPUT(java.nio.ByteBuffer container)
Creates aMOUSEINPUTinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturnssizeof(struct).
-
dx
public int dx()
Returns the value of thedxfield.
-
dy
public int dy()
Returns the value of thedyfield.
-
mouseData
public int mouseData()
Returns the value of themouseDatafield.
-
dwFlags
public int dwFlags()
Returns the value of thedwFlagsfield.
-
time
public int time()
Returns the value of thetimefield.
-
dwExtraInfo
public long dwExtraInfo()
Returns the value of thedwExtraInfofield.
-
dx
public MOUSEINPUT dx(int value)
Sets the specified value to thedxfield.
-
dy
public MOUSEINPUT dy(int value)
Sets the specified value to thedyfield.
-
mouseData
public MOUSEINPUT mouseData(int value)
Sets the specified value to themouseDatafield.
-
dwFlags
public MOUSEINPUT dwFlags(int value)
Sets the specified value to thedwFlagsfield.
-
time
public MOUSEINPUT time(int value)
Sets the specified value to thetimefield.
-
dwExtraInfo
public MOUSEINPUT dwExtraInfo(long value)
Sets the specified value to thedwExtraInfofield.
-
set
public MOUSEINPUT set(int dx, int dy, int mouseData, int dwFlags, int time, long dwExtraInfo)
Initializes this struct with the specified values.
-
set
public MOUSEINPUT set(MOUSEINPUT src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static MOUSEINPUT malloc()
Returns a newMOUSEINPUTinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static MOUSEINPUT calloc()
Returns a newMOUSEINPUTinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static MOUSEINPUT create()
Returns a newMOUSEINPUTinstance allocated withBufferUtils.
-
create
public static MOUSEINPUT create(long address)
Returns a newMOUSEINPUTinstance for the specified memory address.
-
createSafe
@Nullable public static MOUSEINPUT createSafe(long address)
-
malloc
public static MOUSEINPUT.Buffer malloc(int capacity)
Returns a newMOUSEINPUT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static MOUSEINPUT.Buffer calloc(int capacity)
Returns a newMOUSEINPUT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static MOUSEINPUT.Buffer create(int capacity)
Returns a newMOUSEINPUT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static MOUSEINPUT.Buffer create(long address, int capacity)
Create aMOUSEINPUT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static MOUSEINPUT.Buffer createSafe(long address, int capacity)
-
mallocStack
public static MOUSEINPUT mallocStack()
Returns a newMOUSEINPUTinstance allocated on the thread-localMemoryStack.
-
callocStack
public static MOUSEINPUT callocStack()
Returns a newMOUSEINPUTinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static MOUSEINPUT mallocStack(MemoryStack stack)
Returns a newMOUSEINPUTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static MOUSEINPUT callocStack(MemoryStack stack)
Returns a newMOUSEINPUTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static MOUSEINPUT.Buffer mallocStack(int capacity)
Returns a newMOUSEINPUT.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static MOUSEINPUT.Buffer callocStack(int capacity)
Returns a newMOUSEINPUT.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static MOUSEINPUT.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newMOUSEINPUT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static MOUSEINPUT.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newMOUSEINPUT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ndx
public static int ndx(long struct)
Unsafe version ofdx().
-
ndy
public static int ndy(long struct)
Unsafe version ofdy().
-
nmouseData
public static int nmouseData(long struct)
Unsafe version ofmouseData().
-
ndwFlags
public static int ndwFlags(long struct)
Unsafe version ofdwFlags().
-
ntime
public static int ntime(long struct)
Unsafe version oftime().
-
ndwExtraInfo
public static long ndwExtraInfo(long struct)
Unsafe version ofdwExtraInfo().
-
ndx
public static void ndx(long struct, int value)Unsafe version ofdx.
-
ndy
public static void ndy(long struct, int value)Unsafe version ofdy.
-
nmouseData
public static void nmouseData(long struct, int value)Unsafe version ofmouseData.
-
ndwFlags
public static void ndwFlags(long struct, int value)Unsafe version ofdwFlags.
-
ntime
public static void ntime(long struct, int value)Unsafe version oftime.
-
ndwExtraInfo
public static void ndwExtraInfo(long struct, long value)Unsafe version ofdwExtraInfo.
-
-