Namespace BSGameLib.Game.Input
Classes
- CharacterEventArgs
A typed character, from CharEntered. The flags come from the bits of Param, which TextInput does not supply, so they are false there.
- DeviceInputManager
Holds the keyboard and gamepad state for this frame and the one before. The input system polls it once a frame.
- DoubleClickDetector
Decides whether a click is the second half of a double-click: close enough in time and in place to the click before it.
- GraphicsMouseCoordinateTransformer
Converts mouse positions from window pixels to the game's logical coordinates, using the render surface.
- InputActionDefinition
The definition of an input action: its id, display name, type and default binding. Create one with Button(string, string, InputBinding, string) or Axis1D(string, string, InputBinding, string).
- InputBinding
The inputs an action is bound to. Create one with CreateButton(IEnumerable<KeyboardKeyBinding>, IEnumerable<GamepadButtonBinding>) or CreateAxis(IEnumerable<KeyboardAxisBinding>, IEnumerable<GamepadAxisBinding>, IEnumerable<GamepadButtonAxisBinding>); a
Withmethod returns a copy with one list replaced.
- InputBindingLocator
Gives code that has no reference to the game a way to reach the input binding service.
- InputBindingService
The default input binding service. It reads the devices once a frame and works out the state of each action.
- InputContextLocator
Gives code that has no reference to the game a way to reach the input context manager.
- InputContextManager
Keeps the pushed input contexts, highest priority first, and offers each action to them in turn.
- KeyboardEventArgs
The data for a key event or a typed character. A key event carries the key and its modifiers; text input carries Character.
- KeyboardManager
The default keyboard manager. It tracks which keys went down or up between frames.
- MouseClickedEvent
Published when the left button is clicked, with where the click was.
- MouseManager
The default mouse manager. It works out button edges and positions each frame, and publishes a MouseClickedEvent for each click.
- PlayerInputManager
Keeps one input slot for each player, with the profile and bindings that player uses. Slot 0 is registered at start with the default bindings.
- PlayerInputProfile
A named set of input settings that a player can use.
- PlayerInputSlot
One player's input: the profile they use and the bindings that read their input.
- SdlClipboard
IClipboard over SDL's own clipboard, which is the platform's.
- TextInput
Receives typed characters while it is enabled, for a text box or a chat line, and keeps the text typed.
- UiInputActions
The ids of the input actions that the UI responds to. Bind them to keys or buttons so that the UI can be used without a mouse.
Structs
- Gamepad.GamepadSnapshot
A copy of one gamepad's state at a moment. Read it with IsPressed(GamepadButton) and GetAxis(GamepadAxis).
- GamepadAxisBinding
A gamepad stick or trigger that drives an axis action.
- GamepadButtonAxisBinding
A pair of gamepad buttons that move an axis action negative and positive.
- GamepadButtonBinding
A gamepad button that triggers a button action.
- InputActionState
The state of one input action for one frame.
- InputContextHandle
Identifies a pushed input context, so that it can be popped. A default handle is not valid.
- InputContextScope
Pops a context when disposed, so that a push can be paired with a
usingblock.
- Keyboard.Snapshot
A copy of the keys that were down at one moment.
- KeyboardAxisBinding
A pair of keys that move an axis action negative and positive.
- KeyboardKeyBinding
A keyboard key that triggers a button action, with any modifier keys that must be held.
- Mouse.Snapshot
The mouse's position and buttons at one moment, with the wheel movement since the last read.
Interfaces
- IClipboard
The system clipboard, as text.
- IInputBindingService
Binds game actions to keys, gamepad buttons and axes, so that game code reads actions rather than devices and the player can change the bindings.
- IInputContext
A set of input handlers, active while it is pushed to InputContextManager.
- IKeyboardManager
Reports the keys that went down, went up or are held, comparing each frame with the one before.
- IMouseCoordinateTransformer
Converts positions from window pixels to the game's logical coordinates.
- IMouseManager
Reports the mouse's buttons, position and clicks, comparing each frame with the one before.
Enums
- GamepadAxis
An analogue stick or trigger axis.
- GamepadButton
A button on a gamepad, named by its place on an Xbox-style layout.
- GamepadType
The kind of controller, so that a game can show the right button names.
- InputActionType
Whether an action is a button, which is pressed or not, or an axis, which has a value.
- InputDeviceSource
The device an action's state came from.
- Key
A key on the keyboard. The values are Windows virtual-key codes.
- KeyModifiers
Modifier keys that must be held with a key for a KeyboardKeyBinding to match.
Delegates
- TextInput.CharEnteredHandler
Called with each character typed while the handler is enabled.