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
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class MOUSEINPUT extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Contains information about a simulated mouse event.Layout
struct MOUSEINPUT { LONG
dx()
; LONGdy()
; DWORDmouseData()
; DWORDdwFlags()
; DWORDtime()
; ULONG_PTRdwExtraInfo()
; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MOUSEINPUT.Buffer
An array ofMOUSEINPUT
structs.
-
Constructor Summary
Constructors Constructor Description MOUSEINPUT(java.nio.ByteBuffer container)
Creates aMOUSEINPUT
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MOUSEINPUT
calloc()
Returns a newMOUSEINPUT
instance allocated withmemCalloc
.static MOUSEINPUT.Buffer
calloc(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withmemCalloc
.static MOUSEINPUT.Buffer
calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static MOUSEINPUT
calloc(org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static MOUSEINPUT
callocStack()
Deprecated.static MOUSEINPUT.Buffer
callocStack(int capacity)
Deprecated.static MOUSEINPUT.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static MOUSEINPUT
callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.static MOUSEINPUT
create()
Returns a newMOUSEINPUT
instance allocated withBufferUtils
.static MOUSEINPUT.Buffer
create(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withBufferUtils
.static MOUSEINPUT
create(long address)
Returns a newMOUSEINPUT
instance for the specified memory address.static MOUSEINPUT.Buffer
create(long address, int capacity)
Create aMOUSEINPUT.Buffer
instance at the specified memory.static MOUSEINPUT
createSafe(long address)
static MOUSEINPUT.Buffer
createSafe(long address, int capacity)
long
dwExtraInfo()
an additional value associated with the mouse event.MOUSEINPUT
dwExtraInfo(long value)
Sets the specified value to thedwExtraInfo()
field.int
dwFlags()
A set of bit flags that specify various aspects of mouse motion and button clicks.MOUSEINPUT
dwFlags(int value)
Sets the specified value to thedwFlags()
field.int
dx()
the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlags
member.MOUSEINPUT
dx(int value)
Sets the specified value to thedx()
field.int
dy()
the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlags
member.MOUSEINPUT
dy(int value)
Sets the specified value to thedy()
field.static MOUSEINPUT
malloc()
Returns a newMOUSEINPUT
instance allocated withmemAlloc
.static MOUSEINPUT.Buffer
malloc(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withmemAlloc
.static MOUSEINPUT.Buffer
malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT.Buffer
instance allocated on the specifiedMemoryStack
.static MOUSEINPUT
malloc(org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT
instance allocated on the specifiedMemoryStack
.static MOUSEINPUT
mallocStack()
Deprecated.static MOUSEINPUT.Buffer
mallocStack(int capacity)
Deprecated.static MOUSEINPUT.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static MOUSEINPUT
mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.int
mouseData()
IfdwFlags
containsUser32.MOUSEEVENTF_WHEEL
, thenmouseData
specifies the amount of wheel movement.MOUSEINPUT
mouseData(int value)
Sets the specified value to themouseData()
field.static long
ndwExtraInfo(long struct)
Unsafe version ofdwExtraInfo()
.static void
ndwExtraInfo(long struct, long value)
Unsafe version ofdwExtraInfo
.static int
ndwFlags(long struct)
Unsafe version ofdwFlags()
.static void
ndwFlags(long struct, int value)
Unsafe version ofdwFlags
.static int
ndx(long struct)
Unsafe version ofdx()
.static void
ndx(long struct, int value)
Unsafe version ofdx
.static int
ndy(long struct)
Unsafe version ofdy()
.static void
ndy(long struct, int value)
Unsafe version ofdy
.static int
nmouseData(long struct)
Unsafe version ofmouseData()
.static void
nmouseData(long struct, int value)
Unsafe version ofmouseData
.static int
ntime(long struct)
Unsafe version oftime()
.static void
ntime(long struct, int value)
Unsafe version oftime
.MOUSEINPUT
set(int dx, int dy, int mouseData, int dwFlags, int time, long dwExtraInfo)
Initializes this struct with the specified values.MOUSEINPUT
set(MOUSEINPUT src)
Copies the specified struct data to this struct.int
sizeof()
int
time()
the time stamp for the event, in milliseconds.MOUSEINPUT
time(int value)
Sets the specified value to thetime()
field.
-
-
-
Constructor Detail
-
MOUSEINPUT
public MOUSEINPUT(java.nio.ByteBuffer container)
Creates aMOUSEINPUT
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
dx
public int dx()
the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlags
member.Absolute data is specified as the x coordinate of the mouse; relative data is specified as the number of pixels moved.
-
dy
public int dy()
the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of thedwFlags
member.Absolute data is specified as the y coordinate of the mouse; relative data is specified as the number of pixels moved.
-
mouseData
public int mouseData()
IfdwFlags
containsUser32.MOUSEEVENTF_WHEEL
, thenmouseData
specifies 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
dwFlags
containsUser32.MOUSEEVENTF_HWHEEL
, thendwData
specifies 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
dwFlags
does not containUser32.MOUSEEVENTF_WHEEL
,User32.MOUSEEVENTF_XDOWN
, orUser32.MOUSEEVENTF_XUP
, thenmouseData
should be zero.If
dwFlags
containsUser32.MOUSEEVENTF_XDOWN
orUser32.MOUSEEVENTF_XUP
, thenmouseData
specifies which X buttons were pressed or released. This value may be any combination of the following flags:User32.XBUTTON1
,User32.XBUTTON2
. One of:User32.XBUTTON1
User32.XBUTTON2
-
dwFlags
public int dwFlags()
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_LEFTDOWN
is set when the left button is first pressed, but not for subsequent motions. Similarly,User32.MOUSEEVENTF_LEFTUP
is set only when the button is first released.You cannot specify both the
User32.MOUSEEVENTF_WHEEL
flag and eitherUser32.MOUSEEVENTF_XDOWN
orUser32.MOUSEEVENTF_XUP
flags simultaneously in thedwFlags
parameter, because they both require use of themouseData
field. One of:
-
time
public int time()
the time stamp for the event, in milliseconds. If this parameter is 0, the system will provide its own time stamp.
-
dwExtraInfo
public long dwExtraInfo()
an additional value associated with the mouse event. An application callsUser32.GetMessageExtraInfo()
to obtain this extra information.
-
dx
public MOUSEINPUT dx(int value)
Sets the specified value to thedx()
field.
-
dy
public MOUSEINPUT dy(int value)
Sets the specified value to thedy()
field.
-
mouseData
public MOUSEINPUT mouseData(int value)
Sets the specified value to themouseData()
field.
-
dwFlags
public MOUSEINPUT dwFlags(int value)
Sets the specified value to thedwFlags()
field.
-
time
public MOUSEINPUT time(int value)
Sets the specified value to thetime()
field.
-
dwExtraInfo
public MOUSEINPUT dwExtraInfo(long value)
Sets the specified value to thedwExtraInfo()
field.
-
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 newMOUSEINPUT
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static MOUSEINPUT calloc()
Returns a newMOUSEINPUT
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static MOUSEINPUT create()
Returns a newMOUSEINPUT
instance allocated withBufferUtils
.
-
create
public static MOUSEINPUT create(long address)
Returns a newMOUSEINPUT
instance for the specified memory address.
-
createSafe
@Nullable public static MOUSEINPUT createSafe(long address)
-
malloc
public static MOUSEINPUT.Buffer malloc(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static MOUSEINPUT.Buffer calloc(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static MOUSEINPUT.Buffer create(int capacity)
Returns a newMOUSEINPUT.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static MOUSEINPUT.Buffer create(long address, int capacity)
Create aMOUSEINPUT.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static MOUSEINPUT.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static MOUSEINPUT mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead.
-
callocStack
@Deprecated public static MOUSEINPUT callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead.
-
mallocStack
@Deprecated public static MOUSEINPUT mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead.
-
callocStack
@Deprecated public static MOUSEINPUT callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead.
-
mallocStack
@Deprecated public static MOUSEINPUT.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead.
-
callocStack
@Deprecated public static MOUSEINPUT.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead.
-
mallocStack
@Deprecated public static MOUSEINPUT.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead.
-
callocStack
@Deprecated public static MOUSEINPUT.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead.
-
malloc
public static MOUSEINPUT malloc(org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static MOUSEINPUT calloc(org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
public static MOUSEINPUT.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
calloc
public static MOUSEINPUT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMOUSEINPUT.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-