Class InputService
Concrete implementation of the input service. Manages input contexts, bindings, and command execution through a command pattern system.
public class InputService : IInputService
- Inheritance
-
InputService
- Implements
- Inherited Members
Constructors
InputService()
Creates a new input service.
public InputService()
Methods
AddBinding(string, InputBinding)
Adds a binding to the specified context.
public void AddBinding(string contextName, InputBinding binding)
Parameters
contextNamestringName of the context to add the binding to
bindingInputBindingThe input binding to add
ClearBindings(string)
Clears all bindings from the specified context.
public void ClearBindings(string contextName)
Parameters
contextNamestringName of the context to clear
LoadConfiguration(string)
Loads input configuration from a file (placeholder implementation).
public void LoadConfiguration(string filePath)
Parameters
filePathstringPath to the configuration file
PopContext(string)
Removes an input context from the stack.
public void PopContext(string contextName)
Parameters
contextNamestringName of the context to remove
PushContext(string, InputContext)
Pushes an input context onto the stack.
public void PushContext(string contextName, InputContext context)
Parameters
contextNamestringUnique identifier for the context
contextInputContextThe input context to push
RemoveBinding(string, string)
Removes a binding from the specified context.
public void RemoveBinding(string contextName, string bindingId)
Parameters
SaveConfiguration(string)
Saves current input configuration to a file (placeholder implementation).
public void SaveConfiguration(string filePath)
Parameters
filePathstringPath to save the configuration file
SetGlobalContext(InputContext)
Sets the global input context.
public void SetGlobalContext(InputContext context)
Parameters
contextInputContextThe global input context
Update(double)
Updates the input system. Should be called once per frame.
public void Update(double deltaTime)
Parameters
deltaTimedoubleTime elapsed since last update
Events
OnCommandExecuted
Event fired when a command is executed.
public event Action<string> OnCommandExecuted
Event Type
OnInputReceived
Event fired when an input is received.
public event Action<InputEvent> OnInputReceived