2015-03-02 09:13:28 +00:00
|
|
|
struct InputMapping {
|
|
|
|
auto bind() -> void;
|
2015-05-24 09:44:28 +00:00
|
|
|
auto bind(shared_pointer<HID::Device> device, unsigned group, unsigned input, int16 oldValue, int16 newValue) -> bool;
|
2015-03-02 09:13:28 +00:00
|
|
|
auto poll() -> int16;
|
Update to v094r13 release.
byuu says:
This version polishes up the input dialogue (reset, erase, disable
button when item not focused, split device ID from mapping name), adds
color emulation toggle, and add dummy menu items for remaining features
(to be filled in later.)
Also, it now compiles cleanly on Windows with GTK.
I didn't test with TDM-GCC-32, because for god knows what reason, the
32-bit version ships with headers from Windows 95 OSR2 only. So I built
with TDM-GCC-64 with arch=x86.
And uh, apparently, moving or resizing a window causes a Visual C++
runtime exception in the GTK+ DLLs. This doesn't happen with trance or
renshuu built with TDM-GCC-32. So, yeah, like I said, don't use -m32.
2015-03-07 10:21:47 +00:00
|
|
|
auto unbind() -> void;
|
2015-03-02 09:13:28 +00:00
|
|
|
|
2015-05-23 05:29:18 +00:00
|
|
|
auto isDigital() const -> bool { return !link || link->type == 0; }
|
|
|
|
auto isAnalog() const -> bool { return link && link->type == 1; }
|
|
|
|
auto isRumble() const -> bool { return link && link->type == 2; }
|
|
|
|
|
2015-05-24 09:44:28 +00:00
|
|
|
auto assignmentName() -> string;
|
|
|
|
auto deviceName() -> string;
|
2015-05-23 05:29:18 +00:00
|
|
|
|
2015-03-02 09:13:28 +00:00
|
|
|
string name;
|
|
|
|
string assignment = "None";
|
|
|
|
Emulator::Interface::Device::Input* link = nullptr;
|
2015-05-24 09:44:28 +00:00
|
|
|
shared_pointer<HID::Device> device;
|
2015-03-02 09:13:28 +00:00
|
|
|
unsigned group = 0;
|
|
|
|
unsigned input = 0;
|
2015-05-23 05:29:18 +00:00
|
|
|
enum class Qualifier : unsigned { None, Lo, Hi, Rumble } qualifier = Qualifier::None;
|
2015-03-02 09:13:28 +00:00
|
|
|
};
|
|
|
|
|
2015-04-13 11:16:33 +00:00
|
|
|
struct InputHotkey : InputMapping {
|
|
|
|
function<void ()> action;
|
|
|
|
|
|
|
|
int16 state = 0;
|
|
|
|
};
|
|
|
|
|
2015-03-02 09:13:28 +00:00
|
|
|
struct InputDevice {
|
|
|
|
string name;
|
|
|
|
vector<InputMapping*> mappings; //pointers used so that addresses do not change when arrays are resized
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InputPort {
|
|
|
|
string name;
|
|
|
|
vector<InputDevice> devices;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InputEmulator {
|
|
|
|
string name;
|
|
|
|
vector<InputPort> ports;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InputManager {
|
|
|
|
InputManager();
|
|
|
|
auto bind() -> void;
|
|
|
|
auto poll() -> void;
|
2015-05-24 09:44:28 +00:00
|
|
|
auto onChange(shared_pointer<HID::Device> device, unsigned group, unsigned input, int16 oldValue, int16 newValue) -> void;
|
2015-03-02 09:13:28 +00:00
|
|
|
auto quit() -> void;
|
|
|
|
|
2015-05-24 09:44:28 +00:00
|
|
|
auto findMouse() -> shared_pointer<HID::Device>;
|
2015-05-23 05:29:18 +00:00
|
|
|
|
2015-04-13 11:16:33 +00:00
|
|
|
//hotkeys.cpp
|
|
|
|
auto appendHotkeys() -> void;
|
|
|
|
auto pollHotkeys() -> void;
|
|
|
|
|
2015-05-24 09:44:28 +00:00
|
|
|
vector<shared_pointer<HID::Device>> devices;
|
2015-03-02 09:13:28 +00:00
|
|
|
vector<InputEmulator> emulators;
|
2015-04-13 11:16:33 +00:00
|
|
|
vector<InputHotkey*> hotkeys;
|
2015-03-02 09:13:28 +00:00
|
|
|
Configuration::Document config;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern InputManager* inputManager;
|