Files
bsnes/target-tomoko/input/input.hpp
Tim Allen c45633550e Update to v094r42 release.
byuu says:

I imagine you guys will like this WIP very much.

Changelog:
- ListView check boxes on Windows
- ListView removal of columns on reset (changing input dropdowns)
- DirectSound audio duplication on latency change
- DirectSound crash on 20ms latency
- Fullscreen window sizing in multi-monitor setups
- Allow joypad bindings of hotkeys
- Allow triggers to be mapped (Xbox 360 / XInput / Windows only)
- Support joypad rumble for Game Boy Player
- Video scale settings modified from {1x,2x,3x} to {2x,3x,4x}
- System menu now renames to active emulation core
- Added fast forward hotkey

Not changing for v095:
- not adding input focus settings yet
- not adding shaders yet

Not changing at all:
- not implementing maximize
2015-08-24 19:42:11 +10:00

66 lines
1.7 KiB
C++

struct InputMapping {
auto bind() -> void;
auto bind(shared_pointer<HID::Device> device, unsigned group, unsigned input, int16 oldValue, int16 newValue) -> bool;
auto poll() -> int16;
auto rumble(bool enable) -> void;
auto unbind() -> void;
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; }
auto assignmentName() -> string;
auto deviceName() -> string;
string name;
string assignment = "None";
Emulator::Interface::Device::Input* link = nullptr;
shared_pointer<HID::Device> device;
unsigned group = 0;
unsigned input = 0;
enum class Qualifier : unsigned { None, Lo, Hi, Rumble } qualifier = Qualifier::None;
};
struct InputHotkey : InputMapping {
function<void ()> press;
function<void ()> release;
int16 state = 0;
};
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;
auto onChange(shared_pointer<HID::Device> device, unsigned group, unsigned input, int16 oldValue, int16 newValue) -> void;
auto quit() -> void;
auto findMouse() -> shared_pointer<HID::Device>;
//hotkeys.cpp
auto appendHotkeys() -> void;
auto pollHotkeys() -> void;
vector<shared_pointer<HID::Device>> devices;
vector<InputEmulator> emulators;
vector<InputHotkey*> hotkeys;
Configuration::Document config;
};
extern InputManager* inputManager;