C# Class Indiefreaks.Xna.Input.KeyboardInputState

ファイルを表示 Open project: Indiefreaks/igf

Public Methods

Method Description
GetHeldKeys ( Action callback ) : void

Calls the callback for each Keys key where Button.IsDown is true

GetHeldKeys ( List heldKeyList ) : void

Adds a key to the heldKeyList for each Keys key where Button.IsDown is true

The list will be cleared before any keys are added

GetKey ( Keys key ) : Button

Gets the Button state of a key

GetKeyArray ( ) : Keys[]

Allocates an array of all values in the Keys enumerator

GetPressedKeys ( Action callback ) : void

Calls the callback for each Keys key where Button.OnPressed is true

GetPressedKeys ( List pressedList ) : void

Adds a key to the pressedList for each Keys key where Button.OnPressed is true

IsKeyDown ( Keys key ) : bool

Returns true if a key is down

IsKeyUp ( Keys key ) : bool

Returns true if a key is up

TryGetKeyChar ( Keys key, char &keyChar ) : bool

Gets the character for a given Keys key. Eg: Keys.A will output 'a'. Uses the current keyboard modifier key state; Shift will convert to upper case, etc.

Returns false if the key character is unknown

this ( Keys key ) : Button

Button Indexer (Keys)

Private Methods

Method Description
GetKeyboardLayout ( uint thread ) : IntPtr
HeldCallback ( Action callback, int group ) : void
HeldList ( List list, int group ) : void
KeyboardInputState ( ) : System
MapVirtualKeyEx ( uint uCode, uint uMapType, IntPtr layout ) : uint
PressCallback ( Action callback, int group ) : void
PressList ( List list, int group ) : void
ToUnicodeEx ( uint wVirtKey, uint wScanCode, byte lpKeyState, char &pwszBuff, int cchBuff, uint wFlags, IntPtr layout ) : int
Update ( long tick, KeyboardState &keyboardState ) : void

Method Details

GetHeldKeys() public method

Calls the callback for each Keys key where Button.IsDown is true

public GetHeldKeys ( Action callback ) : void
callback Action
return void

GetHeldKeys() public method

Adds a key to the heldKeyList for each Keys key where Button.IsDown is true

The list will be cleared before any keys are added

public GetHeldKeys ( List heldKeyList ) : void
heldKeyList List
return void

GetKey() public method

Gets the Button state of a key
public GetKey ( Keys key ) : Button
key Keys
return Button

GetKeyArray() public static method

Allocates an array of all values in the Keys enumerator
public static GetKeyArray ( ) : Keys[]
return Keys[]

GetPressedKeys() public method

Calls the callback for each Keys key where Button.OnPressed is true
public GetPressedKeys ( Action callback ) : void
callback Action
return void

GetPressedKeys() public method

Adds a key to the pressedList for each Keys key where Button.OnPressed is true
public GetPressedKeys ( List pressedList ) : void
pressedList List
return void

IsKeyDown() public method

Returns true if a key is down
public IsKeyDown ( Keys key ) : bool
key Keys
return bool

IsKeyUp() public method

Returns true if a key is up
public IsKeyUp ( Keys key ) : bool
key Keys
return bool

TryGetKeyChar() public method

Gets the character for a given Keys key. Eg: Keys.A will output 'a'. Uses the current keyboard modifier key state; Shift will convert to upper case, etc.

Returns false if the key character is unknown

public TryGetKeyChar ( Keys key, char &keyChar ) : bool
key Keys
keyChar char
return bool

this() public method

Button Indexer (Keys)
public this ( Keys key ) : Button
key Keys
return Button