Cogs.Core
Source
Input
IInputProvider.h
1
#pragma once
2
3
#include <memory>
4
5
#include "Context.h"
6
#include "IInputDevice.h"
7
8
namespace
Cogs
9
{
10
namespace
Core
11
{
15
struct
InputDeviceIdentifier
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
32
struct
InputIdentifier
33
{
35
InputDeviceIdentifier
deviceId
;
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
48
class
IInputProvider
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
}
Cogs::Core::IInputDevice
Definition:
IInputDevice.h:10
Cogs::Core::IInputProvider
Definition:
IInputProvider.h:49
Cogs::Core::InputManager
Input manager responsible for handling input from various devices, including mouse,...
Definition:
InputManager.h:37
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::Core::InputDeviceIdentifier
Identifier for an input device.
Definition:
IInputProvider.h:16
Cogs::Core::InputDeviceIdentifier::driver
std::string driver
Input subsystem to handle this device (openvr, directinput etc)
Definition:
IInputProvider.h:18
Cogs::Core::InputDeviceIdentifier::id
std::string id
Device identifier within the input subsystem.
Definition:
IInputProvider.h:21
Cogs::Core::InputIdentifier
Identifier for an input device axis.
Definition:
IInputProvider.h:33
Cogs::Core::InputIdentifier::inputName
std::string inputName
Axis or button name.
Definition:
IInputProvider.h:38
Cogs::Core::InputIdentifier::deviceId
InputDeviceIdentifier deviceId
Identifier for the specific input device.
Definition:
IInputProvider.h:35
Generated by
1.9.6