C# Class SadConsole.Input.AsciiKey

Represents the state of a single key.
Show file Open project: Thraka/SadConsole Class Usage Examples

Public Properties

Property Type Description
Character char
PreviouslyPressed bool
TimeHeld float
XnaKey Keys

Public Methods

Method Description
Equals ( object obj ) : bool

Compares references.

Fill ( Keys key, bool shiftPressed ) : void

Fills out the fields based on the MonoGame/XNA key.

Get ( Keys key ) : AsciiKey

Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type. Shift is considered not pressed.

Get ( Keys key, bool shiftPressed ) : AsciiKey

Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type.

operator ( ) : bool

Compares if the Character field of two AsciiKey instances are the same.

Method Details

Equals() public method

Compares references.
public Equals ( object obj ) : bool
obj object
return bool

Fill() public method

Fills out the fields based on the MonoGame/XNA key.
public Fill ( Keys key, bool shiftPressed ) : void
key Keys The key.
shiftPressed bool Helps identify which to use while the key is pressed. For example, if is used the field will be either 'A' if is true or 'a' if false.
return void

Get() public static method

Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type. Shift is considered not pressed.
public static Get ( Keys key ) : AsciiKey
key Keys The key.
return AsciiKey

Get() public static method

Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type.
public static Get ( Keys key, bool shiftPressed ) : AsciiKey
key Keys The key.
shiftPressed bool If shift should be considered pressed or not.
return AsciiKey

operator() public static method

Compares if the Character field of two AsciiKey instances are the same.
public static operator ( ) : bool
return bool

Property Details

Character public property

The keyboard character of the key.
public char Character
return char

PreviouslyPressed public property

Tracks if the key was previously held when calcualting the KeyboardInfo.InitialRepeatDelay.
public bool PreviouslyPressed
return bool

TimeHeld public property

Total time the key has been held.
public float TimeHeld
return float

XnaKey public property

The key from MonoGame or XNA.
public Keys XnaKey
return Keys