161 changes: 4 additions & 157 deletions Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h
Expand Up @@ -9,18 +9,13 @@

#include "Common.h"
#include "Thread.h"
#include "Device.h"

// enable disable sources
#ifdef _WIN32
#define CIFACE_USE_XINPUT
#define CIFACE_USE_DINPUT_JOYSTICK
#define CIFACE_USE_DINPUT_KBM
#define CIFACE_USE_DINPUT
//#ifndef CIFACE_USE_DINPUT_JOYSTICK
// enable SDL 1.2 in addition to DirectInput on windows,
// to support a few gamepads that aren't behaving with DInput
#define CIFACE_USE_SDL
//#endif
#endif
#if defined(HAVE_X11) && HAVE_X11
#define CIFACE_USE_XLIB
Expand All @@ -32,158 +27,19 @@
#ifdef ANDROID
#define CIFACE_USE_ANDROID
#endif

// idk in case I wanted to change it to double or something, idk what's best
typedef float ControlState;

using namespace ciface::Core;

//
// ControllerInterface
//
// some crazy shit I made to control different device inputs and outputs
// from lots of different sources, hopefully more easily
//
class ControllerInterface
class ControllerInterface : public DeviceContainer
{
public:

// Forward declarations
class DeviceQualifier;

//
// Device
//
// a device class
//
class Device
{
public:
class Input;
class Output;

//
// Control
//
// control includes inputs and outputs
//
class Control // input or output
{
public:
virtual std::string GetName() const = 0;
virtual ~Control() {}

virtual Input* ToInput() { return NULL; }
virtual Output* ToOutput() { return NULL; }
};

//
// Input
//
// an input on a device
//
class Input : public Control
{
public:
// things like absolute axes/ absolute mouse position will override this
virtual bool IsDetectable() { return true; }

virtual ControlState GetState() const = 0;

Input* ToInput() { return this; }
};

//
// Output
//
// an output on a device
//
class Output : public Control
{
public:
virtual ~Output() {}

virtual void SetState(ControlState state) = 0;

Output* ToOutput() { return this; }
};

virtual ~Device();

virtual std::string GetName() const = 0;
virtual int GetId() const = 0;
virtual std::string GetSource() const = 0;
virtual bool UpdateInput() = 0;
virtual bool UpdateOutput() = 0;

virtual void ClearInputState();

const std::vector<Input*>& Inputs() const { return m_inputs; }
const std::vector<Output*>& Outputs() const { return m_outputs; }

Input* FindInput(const std::string& name) const;
Output* FindOutput(const std::string& name) const;

protected:
void AddInput(Input* const i);
void AddOutput(Output* const o);

class FullAnalogSurface : public Input
{
public:
FullAnalogSurface(Input* low, Input* high)
: m_low(*low), m_high(*high)
{}

ControlState GetState() const
{
return (1 + m_high.GetState() - m_low.GetState()) / 2;
}

std::string GetName() const
{
return m_low.GetName() + *m_high.GetName().rbegin();
}

private:
Input& m_low;
Input& m_high;
};

void AddAnalogInputs(Input* low, Input* high)
{
AddInput(low);
AddInput(high);
AddInput(new FullAnalogSurface(low, high));
AddInput(new FullAnalogSurface(high, low));
}

private:
std::vector<Input*> m_inputs;
std::vector<Output*> m_outputs;
};

//
// DeviceQualifier
//
// device qualifier used to match devices
// currently has ( source, id, name ) properties which match a device
//
class DeviceQualifier
{
public:
DeviceQualifier() : cid(-1) {}
DeviceQualifier(const std::string& _source, const int _id, const std::string& _name)
: source(_source), cid(_id), name(_name) {}
void FromDevice(const Device* const dev);
void FromString(const std::string& str);
std::string ToString() const;
bool operator==(const DeviceQualifier& devq) const;
bool operator==(const Device* const dev) const;

std::string source;
int cid;
std::string name;
};

//
// ControlReference
//
Expand Down Expand Up @@ -260,22 +116,13 @@ class ControllerInterface
bool UpdateInput(const bool force = false);
bool UpdateOutput(const bool force = false);

Device::Input* FindInput(const std::string& name, const Device* def_dev) const;
Device::Output* FindOutput(const std::string& name, const Device* def_dev) const;

const std::vector<Device*>& Devices() const { return m_devices; }
Device* FindDevice(const DeviceQualifier& devq) const;

std::recursive_mutex update_lock;

private:
bool m_is_init;
std::vector<Device*> m_devices;
void* m_hwnd;
};

typedef std::vector<ControllerInterface::Device*> DeviceList;

extern ControllerInterface g_controller_interface;

#endif
19 changes: 3 additions & 16 deletions Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
@@ -1,17 +1,10 @@
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_DINPUT

#include "DInput.h"

#include "StringUtil.h"

#ifdef CIFACE_USE_DINPUT_JOYSTICK
#include "DInputJoystick.h"
#endif
#ifdef CIFACE_USE_DINPUT_KBM
#include "DInputKeyboardMouse.h"
#endif
#include "DInputJoystick.h"
#include "DInputKeyboardMouse.h"

#pragma comment(lib, "Dinput8.lib")
#pragma comment(lib, "dxguid.lib")
Expand Down Expand Up @@ -55,24 +48,18 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
return result;
}

void Init(std::vector<ControllerInterface::Device*>& devices, HWND hwnd)
void Init(std::vector<Core::Device*>& devices, HWND hwnd)
{
IDirectInput8* idi8;
if (FAILED(DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, NULL)))
return;

#ifdef CIFACE_USE_DINPUT_KBM
InitKeyboardMouse(idi8, devices, hwnd);
#endif
#ifdef CIFACE_USE_DINPUT_JOYSTICK
InitJoystick(idi8, devices, hwnd);
#endif

idi8->Release();

}

}
}

#endif
@@ -1,7 +1,7 @@
#ifndef _CIFACE_DINPUT_H_
#define _CIFACE_DINPUT_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#define DINPUT_SOURCE_NAME "DInput"

Expand All @@ -23,7 +23,7 @@ BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVO
BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef);
std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device);

void Init(std::vector<ControllerInterface::Device*>& devices, HWND hwnd);
void Init(std::vector<Core::Device*>& devices, HWND hwnd);

}
}
Expand Down
@@ -1,10 +1,11 @@
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_DINPUT_JOYSTICK

#include "DInputJoystick.h"
#include "DInput.h"

#include <map>
#include <sstream>
#include <algorithm>

namespace ciface
{
namespace DInput
Expand Down Expand Up @@ -142,7 +143,7 @@ void GetXInputGUIDS( std::vector<DWORD>& guids )
}
#endif

void InitJoystick(IDirectInput8* const idi8, std::vector<ControllerInterface::Device*>& devices, HWND hwnd)
void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd)
{
std::list<DIDEVICEINSTANCE> joysticks;
idi8->EnumDevices( DI8DEVCLASS_GAMECTRL, DIEnumDevicesCallback, (LPVOID)&joysticks, DIEDFL_ATTACHEDONLY );
Expand Down Expand Up @@ -599,5 +600,3 @@ Joystick::Force<P>::Force(u8 index, EffectState& state)

}
}

#endif
@@ -1,7 +1,7 @@
#ifndef _CIFACE_DINPUT_JOYSTICK_H_
#define _CIFACE_DINPUT_JOYSTICK_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#define DIRECTINPUT_VERSION 0x0800
#define WIN32_LEAN_AND_MEAN
Expand All @@ -11,21 +11,14 @@

#include <list>

#ifdef CIFACE_USE_XINPUT
// this takes so long, idk if it should be enabled :(
#define NO_DUPLICATE_DINPUT_XINPUT
#include <wbemidl.h>
#include <oleauto.h>
#endif

namespace ciface
{
namespace DInput
{

void InitJoystick(IDirectInput8* const idi8, std::vector<ControllerInterface::Device*>& devices, HWND hwnd);
void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd);

class Joystick : public ControllerInterface::Device
class Joystick : public Core::Device
{
private:
struct EffectState
Expand Down
@@ -1,6 +1,3 @@
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_DINPUT_KBM

#include "DInputKeyboardMouse.h"
#include "DInput.h"
Expand Down Expand Up @@ -42,7 +39,7 @@ static const struct
// lil silly
static HWND hwnd;

void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<ControllerInterface::Device*>& devices, HWND _hwnd)
void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND _hwnd)
{
hwnd = _hwnd;

Expand Down Expand Up @@ -252,16 +249,6 @@ std::string KeyboardMouse::GetSource() const
return DINPUT_SOURCE_NAME;
}

//ControlState KeyboardMouse::GetInputState(const ControllerInterface::Device::Input* const input) const
//{
// return (((Input*)input)->GetState(&m_state_in));
//}
//
//void KeyboardMouse::SetOutputState(const ControllerInterface::Device::Output* const output, const ControlState state)
//{
// ((Output*)output)->SetState(state, m_state_out);
//}

// names
std::string KeyboardMouse::Key::GetName() const
{
Expand Down Expand Up @@ -322,5 +309,3 @@ void KeyboardMouse::Light::SetState(const ControlState state)

}
}

#endif
@@ -1,7 +1,7 @@
#ifndef _CIFACE_DINPUT_KBM_H_
#define _CIFACE_DINPUT_KBM_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#define DIRECTINPUT_VERSION 0x0800
#define WIN32_LEAN_AND_MEAN
Expand All @@ -14,9 +14,9 @@ namespace ciface
namespace DInput
{

void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<ControllerInterface::Device*>& devices, HWND _hwnd);
void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND _hwnd);

class KeyboardMouse : public ControllerInterface::Device
class KeyboardMouse : public Core::Device
{
private:
struct State
Expand Down
193 changes: 193 additions & 0 deletions Source/Core/InputCommon/Src/ControllerInterface/Device.cpp
@@ -0,0 +1,193 @@

#include "Device.h"

#include <string>
#include <sstream>

namespace ciface
{
namespace Core
{

//
// Device :: ~Device
//
// Destructor, delete all inputs/outputs on device destruction
//
Device::~Device()
{
{
// delete inputs
std::vector<Device::Input*>::iterator
i = m_inputs.begin(),
e = m_inputs.end();
for ( ;i!=e; ++i)
delete *i;
}

{
// delete outputs
std::vector<Device::Output*>::iterator
o = m_outputs.begin(),
e = m_outputs.end();
for ( ;o!=e; ++o)
delete *o;
}
}

void Device::AddInput(Device::Input* const i)
{
m_inputs.push_back(i);
}

void Device::AddOutput(Device::Output* const o)
{
m_outputs.push_back(o);
}

Device::Input* Device::FindInput(const std::string &name) const
{
std::vector<Input*>::const_iterator
it = m_inputs.begin(),
itend = m_inputs.end();
for (; it != itend; ++it)
if ((*it)->GetName() == name)
return *it;

return NULL;
}

Device::Output* Device::FindOutput(const std::string &name) const
{
std::vector<Output*>::const_iterator
it = m_outputs.begin(),
itend = m_outputs.end();
for (; it != itend; ++it)
if ((*it)->GetName() == name)
return *it;

return NULL;
}

//
// Device :: ClearInputState
//
// Device classes should override this function
// ControllerInterface will call this when the device returns failure during UpdateInput
// used to try to set all buttons and axes to their default state when user unplugs a gamepad during play
// buttons/axes that were held down at the time of unplugging should be seen as not pressed after unplugging
//
void Device::ClearInputState()
{
// this is going to be called for every UpdateInput call that fails
// kinda slow but, w/e, should only happen when user unplugs a device while playing
}

//
// DeviceQualifier :: ToString
//
// get string from a device qualifier / serialize
//
std::string DeviceQualifier::ToString() const
{
if (source.empty() && (cid < 0) && name.empty())
return "";
std::ostringstream ss;
ss << source << '/';
if ( cid > -1 )
ss << cid;
ss << '/' << name;
return ss.str();
}

//
// DeviceQualifier :: FromString
//
// set a device qualifier from a string / unserialize
//
void DeviceQualifier::FromString(const std::string& str)
{
std::istringstream ss(str);

std::getline(ss, source = "", '/');

// silly
std::getline(ss, name, '/');
std::istringstream(name) >> (cid = -1);

std::getline(ss, name = "");
}

//
// DeviceQualifier :: FromDevice
//
// set a device qualifier from a device
//
void DeviceQualifier::FromDevice(const Device* const dev)
{
name = dev->GetName();
cid = dev->GetId();
source= dev->GetSource();
}

bool DeviceQualifier::operator==(const Device* const dev) const
{
if (dev->GetId() == cid)
if (dev->GetName() == name)
if (dev->GetSource() == source)
return true;
return false;
}

bool DeviceQualifier::operator==(const DeviceQualifier& devq) const
{
if (cid == devq.cid)
if (name == devq.name)
if (source == devq.source)
return true;

return false;
}

Device* DeviceContainer::FindDevice(const DeviceQualifier& devq) const
{
std::vector<Device*>::const_iterator
di = m_devices.begin(),
de = m_devices.end();
for (; di!=de; ++di)
if (devq == *di)
return *di;

return NULL;
}

Device::Input* DeviceContainer::FindInput(const std::string& name, const Device* def_dev) const
{
if (def_dev)
{
Device::Input* const inp = def_dev->FindInput(name);
if (inp)
return inp;
}

std::vector<Device*>::const_iterator
di = m_devices.begin(),
de = m_devices.end();
for (; di != de; ++di)
{
Device::Input* const i = (*di)->FindInput(name);

if (i)
return i;
}

return NULL;
}

Device::Output* DeviceContainer::FindOutput(const std::string& name, const Device* def_dev) const
{
return def_dev->FindOutput(name);
}

}
}
171 changes: 171 additions & 0 deletions Source/Core/InputCommon/Src/ControllerInterface/Device.h
@@ -0,0 +1,171 @@

#ifndef _DEVICE_H_
#define _DEVICE_H_

#include <string>
#include <vector>

#include "Common.h"

// idk in case I wanted to change it to double or something, idk what's best
typedef float ControlState;

namespace ciface
{
namespace Core
{

// Forward declarations
class DeviceQualifier;

//
// Device
//
// a device class
//
class Device
{
public:
class Input;
class Output;

//
// Control
//
// control includes inputs and outputs
//
class Control // input or output
{
public:
virtual std::string GetName() const = 0;
virtual ~Control() {}

virtual Input* ToInput() { return NULL; }
virtual Output* ToOutput() { return NULL; }
};

//
// Input
//
// an input on a device
//
class Input : public Control
{
public:
// things like absolute axes/ absolute mouse position will override this
virtual bool IsDetectable() { return true; }

virtual ControlState GetState() const = 0;

Input* ToInput() { return this; }
};

//
// Output
//
// an output on a device
//
class Output : public Control
{
public:
virtual ~Output() {}

virtual void SetState(ControlState state) = 0;

Output* ToOutput() { return this; }
};

virtual ~Device();

virtual std::string GetName() const = 0;
virtual int GetId() const = 0;
virtual std::string GetSource() const = 0;
virtual bool UpdateInput() = 0;
virtual bool UpdateOutput() = 0;

virtual void ClearInputState();

const std::vector<Input*>& Inputs() const { return m_inputs; }
const std::vector<Output*>& Outputs() const { return m_outputs; }

Input* FindInput(const std::string& name) const;
Output* FindOutput(const std::string& name) const;

protected:
void AddInput(Input* const i);
void AddOutput(Output* const o);

class FullAnalogSurface : public Input
{
public:
FullAnalogSurface(Input* low, Input* high)
: m_low(*low), m_high(*high)
{}

ControlState GetState() const
{
return (1 + m_high.GetState() - m_low.GetState()) / 2;
}

std::string GetName() const
{
return m_low.GetName() + *m_high.GetName().rbegin();
}

private:
Input& m_low;
Input& m_high;
};

void AddAnalogInputs(Input* low, Input* high)
{
AddInput(low);
AddInput(high);
AddInput(new FullAnalogSurface(low, high));
AddInput(new FullAnalogSurface(high, low));
}

private:
std::vector<Input*> m_inputs;
std::vector<Output*> m_outputs;
};

//
// DeviceQualifier
//
// device qualifier used to match devices
// currently has ( source, id, name ) properties which match a device
//
class DeviceQualifier
{
public:
DeviceQualifier() : cid(-1) {}
DeviceQualifier(const std::string& _source, const int _id, const std::string& _name)
: source(_source), cid(_id), name(_name) {}
void FromDevice(const Device* const dev);
void FromString(const std::string& str);
std::string ToString() const;
bool operator==(const DeviceQualifier& devq) const;
bool operator==(const Device* const dev) const;

std::string source;
int cid;
std::string name;
};

class DeviceContainer
{
public:
Device::Input* FindInput(const std::string& name, const Device* def_dev) const;
Device::Output* FindOutput(const std::string& name, const Device* def_dev) const;

const std::vector<Device*>& Devices() const { return m_devices; }
Device* FindDevice(const DeviceQualifier& devq) const;
protected:
std::vector<Device*> m_devices;
};

}
}

#endif
4 changes: 2 additions & 2 deletions Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.h
@@ -1,13 +1,13 @@
#pragma once

#include "../ControllerInterface.h"
#include "../Device.h"

namespace ciface
{
namespace OSX
{

void Init(std::vector<ControllerInterface::Device*>& devices, void *window);
void Init(std::vector<Core::Device*>& devices, void *window);
void DeInit();

void DeviceElementDebugPrint(const void *, void *);
Expand Down
9 changes: 5 additions & 4 deletions Source/Core/InputCommon/Src/ControllerInterface/OSX/OSX.mm
Expand Up @@ -2,11 +2,12 @@
#include <IOKit/hid/IOHIDLib.h>
#include <Cocoa/Cocoa.h>

#include "../ControllerInterface.h"
#include "OSX.h"
#include "OSXKeyboard.h"
#include "OSXJoystick.h"

#include <map>

namespace ciface
{
namespace OSX
Expand Down Expand Up @@ -145,8 +146,8 @@ static void DeviceMatching_callback(void* inContext,

DeviceDebugPrint(inIOHIDDeviceRef);

std::vector<ControllerInterface::Device*> *devices =
(std::vector<ControllerInterface::Device*> *)inContext;
std::vector<Core::Device*> *devices =
(std::vector<Core::Device*> *)inContext;

// Add to the devices vector if it's of a type we want
if (IOHIDDeviceConformsTo(inIOHIDDeviceRef,
Expand All @@ -164,7 +165,7 @@ static void DeviceMatching_callback(void* inContext,
name, joy_name_counts[name]++));
}

void Init(std::vector<ControllerInterface::Device*>& devices, void *window)
void Init(std::vector<Core::Device*>& devices, void *window)
{
HIDManager = IOHIDManagerCreate(kCFAllocatorDefault,
kIOHIDOptionsTypeNone);
Expand Down
@@ -1,13 +1,13 @@
#include <IOKit/hid/IOHIDLib.h>

#include "../ControllerInterface.h"
#include "../Device.h"

namespace ciface
{
namespace OSX
{

class Joystick : public ControllerInterface::Device
class Joystick : public Core::Device
{
private:
class Button : public Input
Expand Down
@@ -1,9 +1,10 @@
#include <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDLib.h>

#include "../ControllerInterface.h"
#include "OSXJoystick.h"

#include <sstream>

namespace ciface
{
namespace OSX
Expand Down
@@ -1,13 +1,13 @@
#include <IOKit/hid/IOHIDLib.h>

#include "../ControllerInterface.h"
#include "../Device.h"

namespace ciface
{
namespace OSX
{

class Keyboard : public ControllerInterface::Device
class Keyboard : public Core::Device
{
private:
class Key : public Input
Expand Down
Expand Up @@ -3,9 +3,10 @@
#include <Cocoa/Cocoa.h>
#include <wx/wx.h> // wxWidgets

#include "../ControllerInterface.h"
#include "OSXKeyboard.h"

#include <sstream>

namespace ciface
{
namespace OSX
Expand Down
11 changes: 5 additions & 6 deletions Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.cpp
@@ -1,10 +1,11 @@
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_SDL

#include "SDL.h"
#include <StringUtil.h>

#include <map>
#include <sstream>
#include <algorithm>

#ifdef _WIN32
#if SDL_VERSION_ATLEAST(1, 3, 0)
#pragma comment(lib, "SDL.1.3.lib")
Expand All @@ -27,7 +28,7 @@ std::string GetJoystickName(int index)
#endif
}

void Init( std::vector<ControllerInterface::Device*>& devices )
void Init( std::vector<Core::Device*>& devices )
{
// this is used to number the joysticks
// multiple joysticks with the same name shall get unique ids starting at 0
Expand Down Expand Up @@ -399,5 +400,3 @@ ControlState Joystick::Hat::GetState() const

}
}

#endif
10 changes: 5 additions & 5 deletions Source/Core/InputCommon/Src/ControllerInterface/SDL/SDL.h
@@ -1,7 +1,7 @@
#ifndef _CIFACE_SDL_H_
#define _CIFACE_SDL_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#include <list>

Expand All @@ -23,9 +23,9 @@ namespace ciface
namespace SDL
{

void Init( std::vector<ControllerInterface::Device*>& devices );
void Init( std::vector<Core::Device*>& devices );

class Joystick : public ControllerInterface::Device
class Joystick : public Core::Device
{
private:

Expand All @@ -40,7 +40,7 @@ class Joystick : public ControllerInterface::Device
};
#endif

class Button : public Input
class Button : public Core::Device::Input
{
public:
std::string GetName() const;
Expand All @@ -51,7 +51,7 @@ class Joystick : public ControllerInterface::Device
const u8 m_index;
};

class Axis : public Input
class Axis : public Core::Device::Input
{
public:
std::string GetName() const;
Expand Down
@@ -1,6 +1,3 @@
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_XINPUT

#include "XInput.h"

Expand Down Expand Up @@ -51,7 +48,7 @@ static const char* const named_motors[] =
"Motor R"
};

void Init(DeviceList& devices)
void Init(std::vector<Core::Device*>& devices)
{
XINPUT_CAPABILITIES caps;
for (int i = 0; i != 4; ++i)
Expand Down Expand Up @@ -210,5 +207,3 @@ void Device::Motor::SetState(ControlState state)

}
}

#endif
14 changes: 7 additions & 7 deletions Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.h
@@ -1,7 +1,7 @@
#ifndef _CIFACE_XINPUT_H_
#define _CIFACE_XINPUT_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#define NOMINMAX
#include <Windows.h>
Expand All @@ -12,12 +12,12 @@ namespace ciface
namespace XInput
{

void Init(DeviceList& devices);
void Init(std::vector<Core::Device*>& devices);

class Device : public ControllerInterface::Device
class Device : public Core::Device
{
private:
class Button : public Input
class Button : public Core::Device::Input
{
public:
std::string GetName() const;
Expand All @@ -28,7 +28,7 @@ class Device : public ControllerInterface::Device
u8 m_index;
};

class Axis : public Input
class Axis : public Core::Device::Input
{
public:
std::string GetName() const;
Expand All @@ -40,7 +40,7 @@ class Device : public ControllerInterface::Device
const u8 m_index;
};

class Trigger : public Input
class Trigger : public Core::Device::Input
{
public:
std::string GetName() const;
Expand All @@ -52,7 +52,7 @@ class Device : public ControllerInterface::Device
const u8 m_index;
};

class Motor : public Output
class Motor : public Core::Device::Output
{
public:
std::string GetName() const;
Expand Down
Expand Up @@ -7,7 +7,7 @@ namespace ciface
namespace Xlib
{

void Init(std::vector<ControllerInterface::Device*>& devices, void* const hwnd)
void Init(std::vector<Core::Device*>& devices, void* const hwnd)
{
devices.push_back(new KeyboardMouse((Window)hwnd));
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.h
@@ -1,7 +1,7 @@
#ifndef _CIFACE_XLIB_H_
#define _CIFACE_XLIB_H_

#include "../ControllerInterface.h"
#include "../Device.h"

#include <X11/Xlib.h>
#include <X11/keysym.h>
Expand All @@ -11,9 +11,9 @@ namespace ciface
namespace Xlib
{

void Init(std::vector<ControllerInterface::Device*>& devices, void* const hwnd);
void Init(std::vector<Core::Device*>& devices, void* const hwnd);

class KeyboardMouse : public ControllerInterface::Device
class KeyboardMouse : public Core::Device
{

private:
Expand Down