Top Description Inners Fields Constructors Methods
org.lwjgl.system.windows

public Class KEYBDINPUT

extends Struct<KEYBDINPUT>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Contains information about a simulated keyboard event.

Layout


struct KEYBDINPUT {
    WORD wVk;
    WORD wScan;
    DWORD dwFlags;
    DWORD time;
    ULONG_PTR dwExtraInfo;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
KEYBDINPUT.Buffer

An array of KEYBDINPUT structs.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
DWEXTRAINFO

The struct member offsets.

public static final int
DWFLAGS

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
TIME

The struct member offsets.

public static final int
WSCAN

The struct member offsets.

public static final int
WVK

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
KEYBDINPUT(long address, ByteBuffer container)

public
KEYBDINPUT(ByteBuffer container)

Creates a KEYBDINPUT instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static KEYBDINPUT
calloc()

Returns a new KEYBDINPUT instance allocated with memCalloc.

public static KEYBDINPUT.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new KEYBDINPUT.Buffer instance allocated with memCalloc.

public static KEYBDINPUT
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new KEYBDINPUT instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static KEYBDINPUT.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new KEYBDINPUT.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static KEYBDINPUT
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected KEYBDINPUT
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static KEYBDINPUT
create()

Returns a new KEYBDINPUT instance allocated with BufferUtils.

public static KEYBDINPUT
create(long address)

Returns a new KEYBDINPUT instance for the specified memory address.

public static KEYBDINPUT.Buffer
create(int
the buffer capacity
capacity
)

Returns a new KEYBDINPUT.Buffer instance allocated with BufferUtils.

public static KEYBDINPUT.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a KEYBDINPUT.Buffer instance at the specified memory.

public static KEYBDINPUT
createSafe(long address)

Like create, but returns null if address is NULL.

public static KEYBDINPUT.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public long
dwExtraInfo()

an additional value associated with the keystroke.

public KEYBDINPUT
dwExtraInfo(long value)

Sets the specified value to the dwExtraInfo field.

public int
dwFlags()

specifies various aspects of a keystroke.

public KEYBDINPUT
dwFlags(int value)

Sets the specified value to the dwFlags field.

public static KEYBDINPUT
malloc()

Returns a new KEYBDINPUT instance allocated with memAlloc.

public static KEYBDINPUT.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new KEYBDINPUT.Buffer instance allocated with memAlloc.

public static KEYBDINPUT
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new KEYBDINPUT instance allocated on the specified MemoryStack.

public static KEYBDINPUT.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new KEYBDINPUT.Buffer instance allocated on the specified MemoryStack.

public static KEYBDINPUT
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static KEYBDINPUT.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static long
ndwExtraInfo(long struct)

Unsafe version of dwExtraInfo.

public static void
ndwExtraInfo(long struct, long value)

Unsafe version of dwExtraInfo.

public static int
ndwFlags(long struct)

Unsafe version of dwFlags.

public static void
ndwFlags(long struct, int value)

Unsafe version of dwFlags.

public static int
ntime(long struct)

Unsafe version of time.

public static void
ntime(long struct, int value)

Unsafe version of time.

public static short
nwScan(long struct)

Unsafe version of wScan.

public static void
nwScan(long struct, short value)

Unsafe version of wScan.

public static short
nwVk(long struct)

Unsafe version of wVk.

public static void
nwVk(long struct, short value)

Unsafe version of wVk.

public KEYBDINPUT
set(short wVk, short wScan, int dwFlags, int time, long dwExtraInfo)

Initializes this struct with the specified values.

public KEYBDINPUT

Returns:

this struct
set
(KEYBDINPUT
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
time()

the time stamp for the event, in milliseconds.

public KEYBDINPUT
time(int value)

Sets the specified value to the time field.

public short
wScan()

A hardware scan code for the key.

public KEYBDINPUT
wScan(short value)

Sets the specified value to the wScan field.

public short
wVk()

A virtual-key code.

public KEYBDINPUT
wVk(short value)

Sets the specified value to the wVk field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

DWEXTRAINFOback to summary
public static final int DWEXTRAINFO

The struct member offsets.

DWFLAGSback to summary
public static final int DWFLAGS

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

TIMEback to summary
public static final int TIME

The struct member offsets.

WSCANback to summary
public static final int WSCAN

The struct member offsets.

WVKback to summary
public static final int WVK

The struct member offsets.

Constructor Detail

KEYBDINPUTback to summary
protected KEYBDINPUT(long address, ByteBuffer container)
KEYBDINPUTback to summary
public KEYBDINPUT(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

callocback to summary
public static KEYBDINPUT calloc()

Returns a new KEYBDINPUT instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static KEYBDINPUT.Buffer calloc(int capacity)

Returns a new KEYBDINPUT.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static KEYBDINPUT calloc(MemoryStack stack)

Returns a new KEYBDINPUT instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static KEYBDINPUT.Buffer calloc(int capacity, MemoryStack stack)

Returns a new KEYBDINPUT.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static KEYBDINPUT callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static KEYBDINPUT callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static KEYBDINPUT.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static KEYBDINPUT.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected KEYBDINPUT create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static KEYBDINPUT create()

Returns a new KEYBDINPUT instance allocated with BufferUtils.

createback to summary
public static KEYBDINPUT create(long address)

Returns a new KEYBDINPUT instance for the specified memory address.

createback to summary
public static KEYBDINPUT.Buffer create(int capacity)

Returns a new KEYBDINPUT.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static KEYBDINPUT.Buffer create(long address, int capacity)

Create a KEYBDINPUT.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static KEYBDINPUT createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static KEYBDINPUT.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
dwExtraInfoback to summary
public long dwExtraInfo()

an additional value associated with the keystroke. Use the User32#GetMessageExtraInfo function to obtain this information.

Annotations
@NativeType:ULONG_PTR
dwExtraInfoback to summary
public KEYBDINPUT dwExtraInfo(long value)

Sets the specified value to the dwExtraInfo field.

dwFlagsback to summary
public int dwFlags()

specifies various aspects of a keystroke. One of:

User32#KEYEVENTF_EXTENDEDKEYUser32#KEYEVENTF_KEYUPUser32#KEYEVENTF_SCANCODEUser32#KEYEVENTF_UNICODE
Annotations
@NativeType:DWORD
dwFlagsback to summary
public KEYBDINPUT dwFlags(int value)

Sets the specified value to the dwFlags field.

mallocback to summary
public static KEYBDINPUT malloc()

Returns a new KEYBDINPUT instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static KEYBDINPUT.Buffer malloc(int capacity)

Returns a new KEYBDINPUT.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static KEYBDINPUT malloc(MemoryStack stack)

Returns a new KEYBDINPUT instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static KEYBDINPUT.Buffer malloc(int capacity, MemoryStack stack)

Returns a new KEYBDINPUT.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static KEYBDINPUT mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static KEYBDINPUT mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static KEYBDINPUT.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static KEYBDINPUT.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
ndwExtraInfoback to summary
public static long ndwExtraInfo(long struct)

Unsafe version of dwExtraInfo.

ndwExtraInfoback to summary
public static void ndwExtraInfo(long struct, long value)

Unsafe version of dwExtraInfo.

ndwFlagsback to summary
public static int ndwFlags(long struct)

Unsafe version of dwFlags.

ndwFlagsback to summary
public static void ndwFlags(long struct, int value)

Unsafe version of dwFlags.

ntimeback to summary
public static int ntime(long struct)

Unsafe version of time.

ntimeback to summary
public static void ntime(long struct, int value)

Unsafe version of time.

nwScanback to summary
public static short nwScan(long struct)

Unsafe version of wScan.

nwScanback to summary
public static void nwScan(long struct, short value)

Unsafe version of wScan.

nwVkback to summary
public static short nwVk(long struct)

Unsafe version of wVk.

nwVkback to summary
public static void nwVk(long struct, short value)

Unsafe version of wVk.

setback to summary
public KEYBDINPUT set(short wVk, short wScan, int dwFlags, int time, long dwExtraInfo)

Initializes this struct with the specified values.

setback to summary
public KEYBDINPUT set(KEYBDINPUT src)

Copies the specified struct data to this struct.

Parameters
src:KEYBDINPUT

the source struct

Returns:KEYBDINPUT

this struct

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
timeback to summary
public int time()

the time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.

Annotations
@NativeType:DWORD
timeback to summary
public KEYBDINPUT time(int value)

Sets the specified value to the time field.

wScanback to summary
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.

Annotations
@NativeType:WORD
wScanback to summary
public KEYBDINPUT wScan(short value)

Sets the specified value to the wScan field.

wVkback to summary
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.

Annotations
@NativeType:WORD
wVkback to summary
public KEYBDINPUT wVk(short value)

Sets the specified value to the wVk field.

org.lwjgl.system.windows back to summary

public Class KEYBDINPUT.Buffer

extends StructBuffer<KEYBDINPUT, KEYBDINPUT.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of KEYBDINPUT structs.

Field Summary

Modifier and TypeField and Description
private static final KEYBDINPUT

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new KEYBDINPUT.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the value of the KEYBDINPUT#dwExtraInfo field.
dwExtraInfo
()

public KEYBDINPUT.Buffer
dwExtraInfo(long value)

Sets the specified value to the KEYBDINPUT#dwExtraInfo field.

public int

Returns:

the value of the KEYBDINPUT#dwFlags field.
dwFlags
()

public KEYBDINPUT.Buffer
dwFlags(int value)

Sets the specified value to the KEYBDINPUT#dwFlags field.

protected KEYBDINPUT
protected KEYBDINPUT.Buffer
public int

Returns:

the value of the KEYBDINPUT#time field.
time
()

public KEYBDINPUT.Buffer
time(int value)

Sets the specified value to the KEYBDINPUT#time field.

public short

Returns:

the value of the KEYBDINPUT#wScan field.
wScan
()

public KEYBDINPUT.Buffer
wScan(short value)

Sets the specified value to the KEYBDINPUT#wScan field.

public short

Returns:

the value of the KEYBDINPUT#wVk field.
wVk
()

public KEYBDINPUT.Buffer
wVk(short value)

Sets the specified value to the KEYBDINPUT#wVk field.

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final KEYBDINPUT ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new KEYBDINPUT.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by KEYBDINPUT#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

dwExtraInfoback to summary
public long dwExtraInfo()
Returns:long

the value of the KEYBDINPUT#dwExtraInfo field.

Annotations
@NativeType:ULONG_PTR
dwExtraInfoback to summary
public KEYBDINPUT.Buffer dwExtraInfo(long value)

Sets the specified value to the KEYBDINPUT#dwExtraInfo field.

dwFlagsback to summary
public int dwFlags()
Returns:int

the value of the KEYBDINPUT#dwFlags field.

Annotations
@NativeType:DWORD
dwFlagsback to summary
public KEYBDINPUT.Buffer dwFlags(int value)

Sets the specified value to the KEYBDINPUT#dwFlags field.

getElementFactoryback to summary
protected KEYBDINPUT getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
selfback to summary
protected KEYBDINPUT.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
timeback to summary
public int time()
Returns:int

the value of the KEYBDINPUT#time field.

Annotations
@NativeType:DWORD
timeback to summary
public KEYBDINPUT.Buffer time(int value)

Sets the specified value to the KEYBDINPUT#time field.

wScanback to summary
public short wScan()
Returns:short

the value of the KEYBDINPUT#wScan field.

Annotations
@NativeType:WORD
wScanback to summary
public KEYBDINPUT.Buffer wScan(short value)

Sets the specified value to the KEYBDINPUT#wScan field.

wVkback to summary
public short wVk()
Returns:short

the value of the KEYBDINPUT#wVk field.

Annotations
@NativeType:WORD
wVkback to summary
public KEYBDINPUT.Buffer wVk(short value)

Sets the specified value to the KEYBDINPUT#wVk field.