Cogs.Core
IInputProvider.h
1#pragma once
2
3#include <memory>
4
5#include "Context.h"
6#include "IInputDevice.h"
7
8namespace Cogs
9{
10 namespace Core
11 {
16 {
18 std::string driver;
19
21 std::string id;
22
23 inline bool operator==(const InputDeviceIdentifier& rhs) const
24 {
25 return rhs.driver == driver && rhs.id == id;
26 }
27 };
28
33 {
36
38 std::string inputName;
39
40 inline bool operator==(const InputIdentifier& rhs) const
41 {
42 return deviceId == rhs.deviceId && inputName == rhs.inputName;
43 }
44 };
45
46 class InputManager;
47
49 {
50 public:
51 virtual ~IInputProvider() {};
52
53 virtual bool canCreate(InputDeviceIdentifier /*deviceId*/) { return false; }
54 virtual IInputDevice* create(InputDeviceIdentifier /*deviceId*/) { return nullptr; }
55
56 virtual void update(InputManager& /*inputManager*/) {}
57
58 protected:
59 IInputProvider() {};
60 };
61 }
62}
Input manager responsible for handling input from various devices, including mouse,...
Definition: InputManager.h:37
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Identifier for an input device.
std::string driver
Input subsystem to handle this device (openvr, directinput etc)
std::string id
Device identifier within the input subsystem.
Identifier for an input device axis.
std::string inputName
Axis or button name.
InputDeviceIdentifier deviceId
Identifier for the specific input device.