10 #include "games/GameTypes.h" 11 #include "input/keyboard/interfaces/IKeyboardDriverHandler.h" 12 #include "input/mouse/interfaces/IMouseDriverHandler.h" 13 #include "peripherals/PeripheralTypes.h" 14 #include "utils/Observer.h" 39 class CGameClientJoystick;
64 void Start(GameClientPtr gameClient);
69 void Notify(
const Observable& obs,
const ObservableMessage msg)
override;
72 bool OnKeyPress(
const CKey& key)
override;
76 bool OnPosition(
int x,
int y)
override;
77 bool OnButtonPress(MOUSE::BUTTON_ID button)
override;
82 using PortAddress = std::string;
83 using JoystickMap = std::map<PortAddress, std::shared_ptr<CGameClientJoystick>>;
84 using PortMap = std::map<JOYSTICK::IInputProvider*, std::shared_ptr<CGameClientJoystick>>;
87 void ProcessJoysticks(PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
88 void ProcessKeyboard();
92 void UpdateExpiredJoysticks(
const PERIPHERALS::PeripheralVector& joysticks,
93 PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
94 void UpdateConnectedJoysticks(
const PERIPHERALS::PeripheralVector& joysticks,
95 const PortMap& newPortMap,
96 PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
99 static PortMap MapJoysticks(
const PERIPHERALS::PeripheralVector& peripheralJoysticks,
100 const JoystickMap& gameClientjoysticks,
108 GameClientPtr m_gameClient;
109 bool m_bHasKeyboard =
false;
110 bool m_bHasMouse =
false;
Definition: RetroPlayerInput.h:15
Class to manage game-playing agents for a running game client.
Definition: GameAgentManager.h:53
void OnKeyRelease(const CKey &key) override
A key has been released.
Definition: GameAgentManager.h:73
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: Observer.h:31
Interface for handling mouse driver events.
Definition: IMouseDriverHandler.h:21
void OnButtonRelease(MOUSE::BUTTON_ID button) override
A mouse button has been released.
Definition: GameAgentManager.h:78
Interface for handling keyboard events.
Definition: IKeyboardDriverHandler.h:21
Definition: Observer.h:44
Definition: Peripherals.h:49