C# Class Artemis.Engine.Input.MouseInput

The main mouse input provider class.
Show file Open project: ArtemisEngine/Artemis-Engine Class Usage Examples

Public Properties

Property Type Description
MouseButtons MouseButton[]
PreviousPositions List

Public Methods

Method Description
IsClicked ( MouseButton button ) : bool

Check if a button is clicked (i.e. pressed for exactly 1 frame).

IsHeld ( MouseButton button ) : bool

Check if a button is being held down (coincides with IsClicked).

IsHeldFor ( MouseButton button, int frames ) : bool

Check if a button has been held down for exactly the given number of frames.

IsHeldForAtleast ( MouseButton button, int frames ) : bool

Check if a button has been held down for at least the given number of frames.

IsMouseStill ( ) : bool

Check if the mouse is still.

IsMouseStillFor ( int frames ) : bool

Check if the mouse has been still for exactly the given number of frames.

IsMouseStillForAtleast ( int frames ) : bool

Check if the mouse has been still for at least the given number of frames.

IsReleased ( MouseButton button ) : bool

Check if a button has been released (i.e. unpressed for exactly 1 frame).

IsUnheld ( MouseButton button ) : bool

Check if a button is not being held down.

IsUnheldFor ( MouseButton button, int frames ) : bool

Check if a button has been left unpressed for exactly the given number of frames.

IsUnheldForAtleast ( MouseButton button, int frames ) : bool

Check if a button has been left unpressed for at least the given number of frames.

MouseInput ( ) : System.Collections.Generic

Private Methods

Method Description
Update ( ) : void

Update the internal state of the mouse.

UpdateButton ( ButtonState state, MouseButton button ) : void

Method Details

IsClicked() public method

Check if a button is clicked (i.e. pressed for exactly 1 frame).
public IsClicked ( MouseButton button ) : bool
button MouseButton
return bool

IsHeld() public method

Check if a button is being held down (coincides with IsClicked).
public IsHeld ( MouseButton button ) : bool
button MouseButton
return bool

IsHeldFor() public method

Check if a button has been held down for exactly the given number of frames.
public IsHeldFor ( MouseButton button, int frames ) : bool
button MouseButton
frames int
return bool

IsHeldForAtleast() public method

Check if a button has been held down for at least the given number of frames.
public IsHeldForAtleast ( MouseButton button, int frames ) : bool
button MouseButton
frames int
return bool

IsMouseStill() public method

Check if the mouse is still.
public IsMouseStill ( ) : bool
return bool

IsMouseStillFor() public method

Check if the mouse has been still for exactly the given number of frames.
public IsMouseStillFor ( int frames ) : bool
frames int
return bool

IsMouseStillForAtleast() public method

Check if the mouse has been still for at least the given number of frames.
public IsMouseStillForAtleast ( int frames ) : bool
frames int
return bool

IsReleased() public method

Check if a button has been released (i.e. unpressed for exactly 1 frame).
public IsReleased ( MouseButton button ) : bool
button MouseButton
return bool

IsUnheld() public method

Check if a button is not being held down.
public IsUnheld ( MouseButton button ) : bool
button MouseButton
return bool

IsUnheldFor() public method

Check if a button has been left unpressed for exactly the given number of frames.
public IsUnheldFor ( MouseButton button, int frames ) : bool
button MouseButton
frames int
return bool

IsUnheldForAtleast() public method

Check if a button has been left unpressed for at least the given number of frames.
public IsUnheldForAtleast ( MouseButton button, int frames ) : bool
button MouseButton
frames int
return bool

MouseInput() public method

public MouseInput ( ) : System.Collections.Generic
return System.Collections.Generic

Property Details

MouseButtons public static property

public static MouseButton[] MouseButtons
return MouseButton[]

PreviousPositions public property

A list of the previous mouse positions (stored for 60 frames).
public List PreviousPositions
return List