Table of Contents

Class KeyboardTarget

Namespace
PAC.Input
public class KeyboardTarget
Inheritance
KeyboardTarget
Inherited Members

Constructors

KeyboardTarget()

public KeyboardTarget()

Fields

allowHoldingKeySpam

public bool allowHoldingKeySpam

Field Value

bool

receiveAlreadyHeldKeys

public bool receiveAlreadyHeldKeys

Field Value

bool

Properties

inputThisFrame

public bool inputThisFrame { get; }

Property Value

bool

keysHeld

The keys that are currently held down, in order of when they were pressed (most recent first).

public CustomKeyCode[] keysHeld { get; }

Property Value

CustomKeyCode[]

keysPressed

public CustomKeyCode[] keysPressed { get; }

Property Value

CustomKeyCode[]

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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()