coastline 0.0.4
Loading...
Searching...
No Matches
input.h File Reference
#include <array>
#include <cstdint>
#include <vector>
#include <SDL3/SDL.h>
#include "controller.h"
#include "controls.h"
#include "raceinput.h"
Include dependency graph for input.h:

Go to the source code of this file.

Classes

struct  coastline::PlayerDevices
 The devices that drive one player. More...
class  coastline::InputBindings
 Open every gamepad in the order it connects, and drive the first two ports with the devices the Player1 and Player2 keys of the Controls section choose. More...

Namespaces

namespace  coastline

Functions

PlayerDevices coastline::AssignedDevices (std::size_t player, std::size_t players)
 Resolve the Player1 and Player2 keys of the Controls section against the open gamepads.
ControllerState coastline::ReadRacePad (const PlayerDevices &devices)
 Read the second player of a race as the console reads a pad: the race actions of the Controls section for each gamepad, and the keyboard bindings of the PC release for the keyboard.
std::int8_t coastline::ScaleStickAxis (std::int16_t axis)
 Scale an SDL axis of -32768 to 32767 to the range of the controller stick.
void coastline::SetScriptedKeys (std::vector< int > scancodes)
 Add simulated key presses alongside physical keyboard input, for tests.
bool coastline::IsKeyDown (SDL_Scancode scancode)
void coastline::IgnoreKeyUntilReleased (SDL_Scancode scancode)
 Report a key as up to IsKeyDown() until it is released, for a key a shortcut of the window consumed, such as Enter of Alt and Enter.
void coastline::SetSecondControllerState (const ControllerState &state)
 Set the state of the second controller the race reads for its second player, until the next call.
int coastline::TakeMouseWheel ()
void coastline::ClearMouseWheel ()
 Discard the wheel of the mouse scrolled since TakeMouseWheel() last read it.