Table of Contents

Class HotKey

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public class HotKey
Inheritance
HotKey
Inherited Members

Fields

Code

The code of the Hotkey.

public string Code

Field Value

string

CurrentMapping

The current key combination for this hotkey

public KeyCombination CurrentMapping

Field Value

KeyCombination

DefaultMapping

The default key combination for this hotkey

public KeyCombination DefaultMapping

Field Value

KeyCombination

Handler

This is the action that happens when the hotkey is used.

public ActionConsumable<KeyCombination> Handler

Field Value

ActionConsumable<KeyCombination>

IsGlobalHotkey

For global hotkeys that shall not be blocked by anything (e.g. F11 for fullscreen, F12 for screenshot)

public bool IsGlobalHotkey

Field Value

bool

IsIngameHotkey

For hotkeys that only available during a game session. When the game session ends, the handler to this hotkey is removed (or we have a dead reference to runninggame)

public bool IsIngameHotkey

Field Value

bool

KeyCombinationType

The type of the key combination. This defaults to HotkeyType.CharacterControls.

public HotkeyType KeyCombinationType

Field Value

HotkeyType

Name

The name of the Hotkey

public string Name

Field Value

string

TriggerOnUpAlso

If true, the handler will be called twice, once on the key or button down event, and once on the up event

public bool TriggerOnUpAlso

Field Value

bool

Methods

Clone()

Clones the hotkey.

public HotKey Clone()

Returns

HotKey

the cloned hotkey.

DidPress(KeyEvent, IWorldAccessor, IPlayer, bool)

Was this hotkey pressed?

public virtual bool DidPress(KeyEvent keyEventargs, IWorldAccessor world, IPlayer player, bool allowCharacterControls)

Parameters

keyEventargs KeyEvent

Event arguments for the given key.

world IWorldAccessor

The current world for the key.

player IPlayer

The player that pressed the buttons.

allowCharacterControls bool

Do we allow character control functions.

Returns

bool

If the hotkey was pressed or not.

FallbackDidPress(KeyEvent, IWorldAccessor, IPlayer, bool)

Fallback version of the DidPress event.

public virtual bool FallbackDidPress(KeyEvent keyEventargs, IWorldAccessor world, IPlayer player, bool allowCharacterControls)

Parameters

keyEventargs KeyEvent

Event arguments for the given key.

world IWorldAccessor

The current world for the key.

player IPlayer

The player that pressed the buttons.

allowCharacterControls bool

Do we allow character control functions.

Returns

bool

If the hotkey was pressed or not.

SetDefaultMapping()

Sets the default keymap for this hotkey.

public void SetDefaultMapping()