Interface IInputService
Service interface for handling input through a command pattern system. Supports context-based input management, key binding, and runtime configuration.
Namespace: PopcorningGuineaPig.Engine.Services
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public interface IInputService
Methods
| Edit this page View SourceAddBinding(string, InputBinding)
Adds a binding to the specified context.
Declaration
void AddBinding(string contextName, InputBinding binding)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | Name of the context to add the binding to |
| InputBinding | binding | The input binding to add |
ClearBindings(string)
Clears all bindings from the specified context.
Declaration
void ClearBindings(string contextName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | Name of the context to clear |
LoadConfiguration(string)
Loads input configuration from the specified file path.
Declaration
void LoadConfiguration(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | Path to the configuration file |
PopContext(string)
Removes the input context with the specified name from the stack.
Declaration
void PopContext(string contextName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | Name of the context to remove |
PushContext(string, InputContext)
Pushes an input context onto the stack with the specified name and priority. Higher priority contexts receive input first.
Declaration
void PushContext(string contextName, InputContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | Unique identifier for the context |
| InputContext | context | The input context to push |
RemoveBinding(string, string)
Removes a binding from the specified context.
Declaration
void RemoveBinding(string contextName, string bindingId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | Name of the context |
| string | bindingId | ID of the binding to remove |
SaveConfiguration(string)
Saves current input configuration to the specified file path.
Declaration
void SaveConfiguration(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | Path to save the configuration file |
SetGlobalContext(InputContext)
Sets the global input context that is always active. Global context has the lowest priority.
Declaration
void SetGlobalContext(InputContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| InputContext | context | The global input context |
Update(double)
Updates the input system. Should be called once per frame.
Declaration
void Update(double deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| double | deltaTime | Time elapsed since last update |
Events
| Edit this page View SourceOnCommandExecuted
Event fired when a command is executed.
Declaration
event Action<string> OnCommandExecuted
Event Type
| Type | Description |
|---|---|
| Action<string> |
OnInputReceived
Event fired when an input is received.
Declaration
event Action<InputEvent> OnInputReceived
Event Type
| Type | Description |
|---|---|
| Action<InputEvent> |