Interface IKeyState
Wrapper around the game keystate buffer, which contains the pressed state for all keyboard keys, indexed by virtual vkCode.
Assembly: Dalamud.dll
View Source
public interface IKeyState
Properties
this[int]
Get or set the key-pressed state for a given vkCode.
View Source
bool this[int vkCode] { get; set; }
this[VirtualKey]
Get or set the key-pressed state for a given vkCode.
View Source
bool this[VirtualKey vkCode] { get; set; }
Methods
GetRawValue(int)
Gets the value in the index array.
View Source
int GetRawValue(int vkCode)
Returns
System.Int32
: The raw value stored in the index array.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vkCode | The virtual key to change. |
Exceptions
System.ArgumentException
If the vkCode is not valid. Refer to Dalamud.Plugin.Services.IKeyState.IsVirtualKeyValid(int) or Dalamud.Plugin.Services.IKeyState.GetValidVirtualKeys().
GetRawValue(VirtualKey)
Gets the value in the index array.
View Source
int GetRawValue(VirtualKey vkCode)
Returns
System.Int32
: The raw value stored in the index array.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.ClientState.Keys.VirtualKey | vkCode | The virtual key to change. |
Exceptions
System.ArgumentException
If the vkCode is not valid. Refer to Dalamud.Plugin.Services.IKeyState.IsVirtualKeyValid(int) or Dalamud.Plugin.Services.IKeyState.GetValidVirtualKeys().
SetRawValue(int, int)
Sets the value in the index array.
View Source
void SetRawValue(int vkCode, int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vkCode | The virtual key to change. |
System.Int32 | value | The raw value to set in the index array. |
Exceptions
System.ArgumentException
If the vkCode is not valid. Refer to Dalamud.Plugin.Services.IKeyState.IsVirtualKeyValid(int) or Dalamud.Plugin.Services.IKeyState.GetValidVirtualKeys().
System.ArgumentOutOfRangeException
If the set value is non-zero.
SetRawValue(VirtualKey, int)
Sets the value in the index array.
View Source
void SetRawValue(VirtualKey vkCode, int value)
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.ClientState.Keys.VirtualKey | vkCode | The virtual key to change. |
System.Int32 | value | The raw value to set in the index array. |
Exceptions
System.ArgumentException
If the vkCode is not valid. Refer to Dalamud.Plugin.Services.IKeyState.IsVirtualKeyValid(int) or Dalamud.Plugin.Services.IKeyState.GetValidVirtualKeys().
System.ArgumentOutOfRangeException
If the set value is non-zero.
IsVirtualKeyValid(int)
Gets a value indicating whether the given VirtualKey code is regarded as valid input by the game.
View Source
bool IsVirtualKeyValid(int vkCode)
Returns
System.Boolean
: If the code is valid.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vkCode | Virtual key code. |
IsVirtualKeyValid(VirtualKey)
Gets a value indicating whether the given VirtualKey code is regarded as valid input by the game.
View Source
bool IsVirtualKeyValid(VirtualKey vkCode)
Returns
System.Boolean
: If the code is valid.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.ClientState.Keys.VirtualKey | vkCode | Virtual key code. |
GetValidVirtualKeys()
Gets an array of virtual keys the game considers valid input.
View Source
IEnumerable<VirtualKey> GetValidVirtualKeys()
Returns
System.Collections.Generic.IEnumerable<Dalamud.Game.ClientState.Keys.VirtualKey>
: An array of valid virtual keys.### ClearAll()
Clears the pressed state for all keys.
View Source
void ClearAll()