Class HotKey
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class HotKey
- Inheritance
-
HotKey
- Inherited Members
- Extension Methods
Fields
Code
The code of the Hotkey.
public string Code
Field Value
CurrentMapping
The current key combination for this hotkey
public KeyCombination CurrentMapping
Field Value
DefaultMapping
The default key combination for this hotkey
public KeyCombination DefaultMapping
Field Value
Handler
This is the action that happens when the hotkey is used.
public ActionConsumable<KeyCombination> Handler
Field Value
IsGlobalHotkey
For global hotkeys that shall not be blocked by anything (e.g. F11 for fullscreen, F12 for screenshot)
public bool IsGlobalHotkey
Field Value
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
KeyCombinationType
The type of the key combination. This defaults to HotkeyType.CharacterControls.
public HotkeyType KeyCombinationType
Field Value
Name
The name of the Hotkey
public string Name
Field Value
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
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
KeyEventEvent arguments for the given key.
world
IWorldAccessorThe current world for the key.
player
IPlayerThe player that pressed the buttons.
allowCharacterControls
boolDo 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
KeyEventEvent arguments for the given key.
world
IWorldAccessorThe current world for the key.
player
IPlayerThe player that pressed the buttons.
allowCharacterControls
boolDo 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()