Class KeyboardTarget
public class KeyboardTarget
- Inheritance
-
KeyboardTarget
- Inherited Members
Constructors
KeyboardTarget()
public KeyboardTarget()
Fields
allowHoldingKeySpam
public bool allowHoldingKeySpam
Field Value
receiveAlreadyHeldKeys
public bool receiveAlreadyHeldKeys
Field Value
Properties
inputThisFrame
public bool inputThisFrame { get; }
Property Value
keysHeld
The keys that are currently held down, in order of when they were pressed (most recent first).
public CustomKeyCode[] keysHeld { get; }
Property Value
keysPressed
public CustomKeyCode[] keysPressed { get; }
Property Value
Methods
IsHeld(CustomKeyCode)
Returns true if all the given key (and potentially some other keys) is held (and is a key detectable by KeyboardTarget).
public bool IsHeld(CustomKeyCode key)
Parameters
key
CustomKeyCode
Returns
IsHeld(params CustomKeyCode[])
Returns true if all the given keys (and potentially some other keys) are held (and are keys detectable by KeyboardTarget).
public bool IsHeld(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
Returns
IsHeld(KeyboardShortcut)
Returns true if all the given key (and potentially some other keys) is held (and is a key detectable by KeyboardTarget).
public bool IsHeld(KeyboardShortcut shortcut)
Parameters
shortcut
KeyboardShortcut
Returns
IsHeldExactly(params CustomKeyCode[])
Returns true if all and only the given keys are held (and are keys detectable by KeyboardTarget).
public bool IsHeldExactly(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
Returns
IsHeldExactly(KeyboardShortcut)
Returns true if all and only the given keys are held (and are keys detectable by KeyboardTarget).
public bool IsHeldExactly(KeyboardShortcut shortcut)
Parameters
shortcut
KeyboardShortcut
Returns
IsPressed(CustomKeyCode)
Returns true if all the given key (and potentially some other keys) has been pressed this frame (and is a key detectable by KeyboardTarget).
public bool IsPressed(CustomKeyCode key)
Parameters
key
CustomKeyCode
Returns
IsPressed(params CustomKeyCode[])
Returns true if all the given keys (and potentially some other keys) have been pressed this frame (and are keys detectable by KeyboardTarget).
public bool IsPressed(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
Returns
IsPressed(KeyboardShortcut)
Returns true if all the given keys (and potentially some other keys) have been pressed this frame (and are keys detectable by KeyboardTarget).
public bool IsPressed(KeyboardShortcut shortcut)
Parameters
shortcut
KeyboardShortcut
Returns
KeyDown(CustomKeyCode)
Simulates the key being pressed, if it is a key detectable by KeyboardTarget.
public void KeyDown(CustomKeyCode key)
Parameters
key
CustomKeyCode
KeyDownNoSpamReset(CustomKeyCode)
Simulates the key being pressed, if it is a key detectable by KeyboardTarget, without restting the timer until key spamming occurs.
public void KeyDownNoSpamReset(CustomKeyCode key)
Parameters
key
CustomKeyCode
KeyUp(CustomKeyCode)
Simulates the key being unpressed.
public void KeyUp(CustomKeyCode key)
Parameters
key
CustomKeyCode
KeysDown(params CustomKeyCode[])
Simulates the keys being pressed, if they are keys detectable by KeyboardTarget.
public void KeysDown(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
KeysDownNoSpamReset(params CustomKeyCode[])
Simulates the keys being pressed, if they are keys detectable by KeyboardTarget, without restting the timer until key spamming occurs.
public void KeysDownNoSpamReset(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
KeysUp(params CustomKeyCode[])
Simulates the keys being unpressed.
public void KeysUp(params CustomKeyCode[] keys)
Parameters
keys
CustomKeyCode[]
ManualUpdate()
Only to be called in InputTarget's Update() method.
public void ManualUpdate()
OneIsHeld(IEnumerable<KeyboardShortcut>)
Returns true if all the given keys (and potentially some other keys) are held (and are keys detectable by KeyboardTarget) for one of the given keyboard shortcuts.
public bool OneIsHeld(IEnumerable<KeyboardShortcut> shortcuts)
Parameters
shortcuts
IEnumerable<KeyboardShortcut>
Returns
OneIsHeldExactly(IEnumerable<KeyboardShortcut>)
Returns true if all and only the given keys are held (and are keys detectable by KeyboardTarget) for one of the given keyboard shortcuts.
public bool OneIsHeldExactly(IEnumerable<KeyboardShortcut> shortcuts)
Parameters
shortcuts
IEnumerable<KeyboardShortcut>
Returns
OneIsPressed(IEnumerable<KeyboardShortcut>)
Returns true if all the given keys (and potentially some other keys) have been pressed this frame (and are keys detectable by KeyboardTarget) for one of the given keyboard shortcuts.
public bool OneIsPressed(IEnumerable<KeyboardShortcut> shortcuts)
Parameters
shortcuts
IEnumerable<KeyboardShortcut>
Returns
SubscribeToOnInput(UnityAction)
public void SubscribeToOnInput(UnityAction call)
Parameters
call
UnityAction
SubscribeToOnKeyDown(UnityAction<CustomKeyCode>)
public void SubscribeToOnKeyDown(UnityAction<CustomKeyCode> call)
Parameters
call
UnityAction<CustomKeyCode>
SubscribeToOnKeyUp(UnityAction<CustomKeyCode>)
public void SubscribeToOnKeyUp(UnityAction<CustomKeyCode> call)
Parameters
call
UnityAction<CustomKeyCode>
SubscribeToUntarget(UnityAction)
public void SubscribeToUntarget(UnityAction call)
Parameters
call
UnityAction
Untarget()
public void Untarget()