C# Class Sharplike.Core.Input.InputSystem

Exibir arquivo Open project: eropple/sharplike Class Usage Examples

Public Methods

Method Description
ClearBindings ( ) : void

Clears all current control bindings.

EndCommand ( CommandData command ) : void

Ends a command that was previously started. This will stop the command from being repeat-triggered.

GetMousePosition ( ) : Point

Retrieves the current screen-space mouse position.

HasWindowEvent ( String eventname ) : bool

Tests if the input system has a command for a particular event.

LoadConfiguration ( Stream file ) : void

Load control bindings from an arbitrary stream. If there are already bindings, the new ones will be added. New bindings overwrite old bindings.

LoadConfiguration ( String filename ) : void

Loads control bindings from a specified path.

SaveConfiguration ( Stream file ) : void

Saves the current control bindings to an arbitrary stream.

SaveConfiguration ( String filename ) : void

Saves the current control bindings to a path on the filesystem.

StartCommand ( CommandData command ) : void

Starts a game command. This command will be duplicated as a trigger, and will be re-triggered as a key-repeat until it is ended by a call to EndCommand().

TriggerCommand ( CommandData command ) : void

Performs a one-shot trigger of a given command.

WindowCommand ( String eventname ) : void

Triggers a window event.

Private Methods

Method Description
InputSystem ( ) : System

Method Details

ClearBindings() public method

Clears all current control bindings.
public ClearBindings ( ) : void
return void

EndCommand() public method

Ends a command that was previously started. This will stop the command from being repeat-triggered.
public EndCommand ( CommandData command ) : void
command CommandData The name of the command to stop
return void

GetMousePosition() public method

Retrieves the current screen-space mouse position.
public GetMousePosition ( ) : Point
return Point

HasWindowEvent() public method

Tests if the input system has a command for a particular event.
public HasWindowEvent ( String eventname ) : bool
eventname String The event to test.
return bool

LoadConfiguration() public method

Load control bindings from an arbitrary stream. If there are already bindings, the new ones will be added. New bindings overwrite old bindings.
public LoadConfiguration ( Stream file ) : void
file Stream The source of the INI data
return void

LoadConfiguration() public method

Loads control bindings from a specified path.
public LoadConfiguration ( String filename ) : void
filename String The path to load from. Note: This does NOT automatically use Game.PathTo()
return void

SaveConfiguration() public method

Saves the current control bindings to an arbitrary stream.
public SaveConfiguration ( Stream file ) : void
file Stream The writable stream to save to.
return void

SaveConfiguration() public method

Saves the current control bindings to a path on the filesystem.
public SaveConfiguration ( String filename ) : void
filename String The location of the file to write to. NOTE: This does NOT automatically use Game.PathTo()
return void

StartCommand() public method

Starts a game command. This command will be duplicated as a trigger, and will be re-triggered as a key-repeat until it is ended by a call to EndCommand().
public StartCommand ( CommandData command ) : void
command CommandData The command to start.
return void

TriggerCommand() public method

Performs a one-shot trigger of a given command.
public TriggerCommand ( CommandData command ) : void
command CommandData The command to trigger.
return void

WindowCommand() public method

Triggers a window event.
public WindowCommand ( String eventname ) : void
eventname String The name of the window event to trigger.
return void