AsciiKey Struct
Definition
Section titled “Definition”Represents the state of a single key.
public struct AsciiKeyFields
Section titled “Fields”CapsLockedKeys
Section titled “CapsLockedKeys”List of Keys to consider as shifted when capslock is on.
public static readonly List<Keys> CapsLockedKeysShiftKeyMappings
Section titled “ShiftKeyMappings”A dictionary that is keyed off of a Keys and associates that key with a character in a shifted and unshifted state.
public static readonly Dictionary<Keys, AsciiKey.ShiftedCharacterMapping> ShiftKeyMappingsNumberKeyMappings
Section titled “NumberKeyMappings”Dictionary that maps Keys usually triggered by the numberpad with a character and non-numpad key.
public static readonly Dictionary<Keys, AsciiKey.CharacterKeyMapping> NumberKeyMappingsKeyRemapping
Section titled “KeyRemapping”Remaps any incoming key to a combination of character and key.
public static readonly Dictionary<Keys, Keys> KeyRemappingThe key from MonoGame or XNA.
public Keys KeyCharacter
Section titled “Character”The keyboard character of the key.
public char CharacterTimeHeld
Section titled “TimeHeld”Total time the key has been held.
public TimeSpan TimeHeldPostInitialDelay
Section titled “PostInitialDelay”Tracks if the key was previously held when calculating the InitialRepeatDelay.
public bool PostInitialDelayMethods
Section titled “Methods”Fill(Keys, bool, IKeyboardState)
Section titled “Fill(Keys, bool, IKeyboardState)”Fills out the fields based on the key.
public void Fill(Keys key, bool shiftPressed, IKeyboardState state)Parameters
Section titled “Parameters”key Keys
The key.
shiftPressed bool
Helps identify which Character to use while the key is pressed.
state IKeyboardState
Keyboard state to read from.
Get(Keys, IKeyboardState)
Section titled “Get(Keys, IKeyboardState)”Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type. Shift is considered not pressed.
public static AsciiKey Get(Keys key, IKeyboardState state)Parameters
Section titled “Parameters”key Keys
The key.
state IKeyboardState
Keyboar state to read from.
Returns
Section titled “Returns”AsciiKey
The AsciiKey of the Keys.
Get(Keys, bool, IKeyboardState)
Section titled “Get(Keys, bool, IKeyboardState)”Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type.
public static AsciiKey Get(Keys key, bool shiftPressed, IKeyboardState state)Parameters
Section titled “Parameters”key Keys
The key.
shiftPressed bool
If shift should be considered pressed or not.
state IKeyboardState
Keyboar state to read from.
Returns
Section titled “Returns”AsciiKey
The AsciiKey of the Keys.
GetHashCode()
Section titled “GetHashCode()”Gets a hashcode based on the key and character.
public override int GetHashCode()Returns
Section titled “Returns”Equals(object?)
Section titled “Equals(object?)”Compares references.
public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object