C# Class Bricklayer.Client.InputHandler

Gets current mouse and keyboard states and provides easy access to them
Show file Open project: Cyral/Bricklayer Class Usage Examples

Public Methods

Method Description
AllKeysDown ( ) : bool

Checks if all of the keys specified are down

AnyKeysDown ( ) : bool

Checks if any of the keys specified are down

AnyKeysPressed ( ) : bool

Checks if any of the keys specified are pressed/toggled

GetDigitPressed ( ) : int

Gets the current number key pressed, returns -1 if none

InputHandler ( ) : System

Creats a new InputHandler

IsKeyDown ( Keys key ) : bool

Checks if a given key is currently down

IsKeyPressed ( Keys key ) : bool

Checks if a given key is currently being pressed (Was not pressed last state, but now is)

IsKeyUp ( Keys key ) : bool

Checks if a given key is currently up

IsLeftClicked ( ) : bool

Checks if the left button is being clicked (Currently is down, wasn't last frame)

IsLeftDown ( ) : bool

Checks if the left button is being held down

IsLeftUp ( ) : bool

Checks if the left button is currently up

IsRightClicked ( ) : bool

Checks if the right button is being clicked (Currently is down, wasn't last frame)

IsRightDown ( ) : bool

Checks if the right button is being held down

IsRightUp ( ) : bool

Checks if the right button is currently up

Update ( ) : void

Updates the input states

WasAllKeysUp ( ) : bool

Checks if all of the keys specified were up last frame

WasAnyKeysDown ( ) : bool

Checks if any of the keys specified were down last frame

WasKeyDown ( Keys key ) : bool

Checks if a given key is was down last frame

WasKeyPressed ( Keys key ) : bool

Checks if a given key has been toggled (Was pressed last state, but now isn't)

WasKeyUp ( Keys key ) : bool

Checks if a given key is was up last frame

WereAnyKeysUp ( ) : bool

Checks if any of the keys specified were up the last frame

Method Details

AllKeysDown() public method

Checks if all of the keys specified are down
public AllKeysDown ( ) : bool
return bool

AnyKeysDown() public method

Checks if any of the keys specified are down
public AnyKeysDown ( ) : bool
return bool

AnyKeysPressed() public method

Checks if any of the keys specified are pressed/toggled
public AnyKeysPressed ( ) : bool
return bool

GetDigitPressed() public method

Gets the current number key pressed, returns -1 if none
public GetDigitPressed ( ) : int
return int

InputHandler() public method

Creats a new InputHandler
public InputHandler ( ) : System
return System

IsKeyDown() public method

Checks if a given key is currently down
public IsKeyDown ( Keys key ) : bool
key Keys
return bool

IsKeyPressed() public method

Checks if a given key is currently being pressed (Was not pressed last state, but now is)
public IsKeyPressed ( Keys key ) : bool
key Keys
return bool

IsKeyUp() public method

Checks if a given key is currently up
public IsKeyUp ( Keys key ) : bool
key Keys
return bool

IsLeftClicked() public method

Checks if the left button is being clicked (Currently is down, wasn't last frame)
public IsLeftClicked ( ) : bool
return bool

IsLeftDown() public method

Checks if the left button is being held down
public IsLeftDown ( ) : bool
return bool

IsLeftUp() public method

Checks if the left button is currently up
public IsLeftUp ( ) : bool
return bool

IsRightClicked() public method

Checks if the right button is being clicked (Currently is down, wasn't last frame)
public IsRightClicked ( ) : bool
return bool

IsRightDown() public method

Checks if the right button is being held down
public IsRightDown ( ) : bool
return bool

IsRightUp() public method

Checks if the right button is currently up
public IsRightUp ( ) : bool
return bool

Update() public method

Updates the input states
public Update ( ) : void
return void

WasAllKeysUp() public method

Checks if all of the keys specified were up last frame
public WasAllKeysUp ( ) : bool
return bool

WasAnyKeysDown() public method

Checks if any of the keys specified were down last frame
public WasAnyKeysDown ( ) : bool
return bool

WasKeyDown() public method

Checks if a given key is was down last frame
public WasKeyDown ( Keys key ) : bool
key Keys
return bool

WasKeyPressed() public method

Checks if a given key has been toggled (Was pressed last state, but now isn't)
public WasKeyPressed ( Keys key ) : bool
key Keys
return bool

WasKeyUp() public method

Checks if a given key is was up last frame
public WasKeyUp ( Keys key ) : bool
key Keys
return bool

WereAnyKeysUp() public method

Checks if any of the keys specified were up the last frame
public WereAnyKeysUp ( ) : bool
return bool