Package org.lwjgl.system.windows
Class KEYBDINPUT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.windows.KEYBDINPUT
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,NativeResource
,Pointer
public class KEYBDINPUT extends Struct implements NativeResource
Contains information about a simulated keyboard event.Member documentation
wVk
– A virtual-key code.The code must be a value in the range 1 to 254. If the
dwFlags
member specifiesUser32.KEYEVENTF_UNICODE
,wVk
must be 0.wScan
– A hardware scan code for the key.If
dwFlags
specifiesUser32.KEYEVENTF_UNICODE
,wScan
specifies a Unicode character which is to be sent to the foreground application.dwFlags
– specifies various aspects of a keystroke. One of:User32.KEYEVENTF_EXTENDEDKEY
User32.KEYEVENTF_KEYUP
User32.KEYEVENTF_SCANCODE
User32.KEYEVENTF_UNICODE
time
– the time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.dwExtraInfo
– an additional value associated with the keystroke. Use theUser32.GetMessageExtraInfo()
function to obtain this information.
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 ofKEYBDINPUT
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
DWEXTRAINFO
DWFLAGSThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
TIME
WSCAN
WVKThe 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 aKEYBDINPUT
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KEYBDINPUT
calloc()
Returns a newKEYBDINPUT
instance allocated withmemCalloc
.static KEYBDINPUT.Buffer
calloc(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withmemCalloc
.static KEYBDINPUT
callocStack()
Returns a newKEYBDINPUT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static KEYBDINPUT.Buffer
callocStack(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static KEYBDINPUT.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newKEYBDINPUT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static KEYBDINPUT
callocStack(MemoryStack stack)
Returns a newKEYBDINPUT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static KEYBDINPUT
create()
Returns a newKEYBDINPUT
instance allocated withBufferUtils
.static KEYBDINPUT.Buffer
create(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withBufferUtils
.static KEYBDINPUT
create(long address)
Returns a newKEYBDINPUT
instance for the specified memory address.static KEYBDINPUT.Buffer
create(long address, int capacity)
Create aKEYBDINPUT.Buffer
instance at the specified memory.static KEYBDINPUT
createSafe(long address)
static KEYBDINPUT.Buffer
createSafe(long address, int capacity)
long
dwExtraInfo()
Returns the value of thedwExtraInfo
field.KEYBDINPUT
dwExtraInfo(long value)
Sets the specified value to thedwExtraInfo
field.int
dwFlags()
Returns the value of thedwFlags
field.KEYBDINPUT
dwFlags(int value)
Sets the specified value to thedwFlags
field.static KEYBDINPUT
malloc()
Returns a newKEYBDINPUT
instance allocated withmemAlloc
.static KEYBDINPUT.Buffer
malloc(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withmemAlloc
.static KEYBDINPUT
mallocStack()
Returns a newKEYBDINPUT
instance allocated on the thread-localMemoryStack
.static KEYBDINPUT.Buffer
mallocStack(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated on the thread-localMemoryStack
.static KEYBDINPUT.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newKEYBDINPUT.Buffer
instance allocated on the specifiedMemoryStack
.static KEYBDINPUT
mallocStack(MemoryStack stack)
Returns a newKEYBDINPUT
instance allocated on the specifiedMemoryStack
.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
ntime(long struct)
Unsafe version oftime()
.static void
ntime(long struct, int value)
Unsafe version oftime
.static short
nwScan(long struct)
Unsafe version ofwScan()
.static void
nwScan(long struct, short value)
Unsafe version ofwScan
.static short
nwVk(long struct)
Unsafe version ofwVk()
.static void
nwVk(long struct, short value)
Unsafe version ofwVk
.KEYBDINPUT
set(short wVk, short wScan, int dwFlags, int time, long dwExtraInfo)
Initializes this struct with the specified values.KEYBDINPUT
set(KEYBDINPUT src)
Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.int
time()
Returns the value of thetime
field.KEYBDINPUT
time(int value)
Sets the specified value to thetime
field.short
wScan()
Returns the value of thewScan
field.KEYBDINPUT
wScan(short value)
Sets the specified value to thewScan
field.short
wVk()
Returns the value of thewVk
field.KEYBDINPUT
wVk(short value)
Sets the specified value to thewVk
field.-
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
-
KEYBDINPUT
public KEYBDINPUT(java.nio.ByteBuffer container)
Creates aKEYBDINPUT
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()
Description copied from class:Struct
Returnssizeof(struct)
.
-
wVk
public short wVk()
Returns the value of thewVk
field.
-
wScan
public short wScan()
Returns the value of thewScan
field.
-
dwFlags
public int dwFlags()
Returns the value of thedwFlags
field.
-
time
public int time()
Returns the value of thetime
field.
-
dwExtraInfo
public long dwExtraInfo()
Returns the value of thedwExtraInfo
field.
-
wVk
public KEYBDINPUT wVk(short value)
Sets the specified value to thewVk
field.
-
wScan
public KEYBDINPUT wScan(short value)
Sets the specified value to thewScan
field.
-
dwFlags
public KEYBDINPUT dwFlags(int value)
Sets the specified value to thedwFlags
field.
-
time
public KEYBDINPUT time(int value)
Sets the specified value to thetime
field.
-
dwExtraInfo
public KEYBDINPUT dwExtraInfo(long value)
Sets the specified value to thedwExtraInfo
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 newKEYBDINPUT
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static KEYBDINPUT calloc()
Returns a newKEYBDINPUT
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static KEYBDINPUT create()
Returns a newKEYBDINPUT
instance allocated withBufferUtils
.
-
create
public static KEYBDINPUT create(long address)
Returns a newKEYBDINPUT
instance for the specified memory address.
-
createSafe
@Nullable public static KEYBDINPUT createSafe(long address)
-
malloc
public static KEYBDINPUT.Buffer malloc(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static KEYBDINPUT.Buffer calloc(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static KEYBDINPUT.Buffer create(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static KEYBDINPUT.Buffer create(long address, int capacity)
Create aKEYBDINPUT.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static KEYBDINPUT.Buffer createSafe(long address, int capacity)
-
mallocStack
public static KEYBDINPUT mallocStack()
Returns a newKEYBDINPUT
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static KEYBDINPUT callocStack()
Returns a newKEYBDINPUT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static KEYBDINPUT mallocStack(MemoryStack stack)
Returns a newKEYBDINPUT
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static KEYBDINPUT callocStack(MemoryStack stack)
Returns a newKEYBDINPUT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static KEYBDINPUT.Buffer mallocStack(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static KEYBDINPUT.Buffer callocStack(int capacity)
Returns a newKEYBDINPUT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static KEYBDINPUT.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newKEYBDINPUT.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static KEYBDINPUT.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newKEYBDINPUT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nwVk
public static short nwVk(long struct)
Unsafe version ofwVk()
.
-
nwScan
public static short nwScan(long struct)
Unsafe version ofwScan()
.
-
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()
.
-
nwVk
public static void nwVk(long struct, short value)
Unsafe version ofwVk
.
-
nwScan
public static void nwScan(long struct, short value)
Unsafe version ofwScan
.
-
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
.
-
-