2018-05-19 02:51:34 +00:00
|
|
|
#include "../bsnes.hpp"
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
#include "hotkeys.cpp"
|
2018-05-19 02:51:34 +00:00
|
|
|
unique_pointer<InputManager> inputManager;
|
|
|
|
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
auto InputMapping::bind() -> void {
|
|
|
|
mappings.reset();
|
|
|
|
|
|
|
|
for(auto& item : assignment.split(logic() == Logic::AND ? "&" : "|")) {
|
|
|
|
auto token = item.split("/");
|
|
|
|
if(token.size() < 3) continue; //skip invalid mappings
|
|
|
|
|
|
|
|
uint64 id = token[0].natural();
|
|
|
|
uint group = token[1].natural();
|
|
|
|
uint input = token[2].natural();
|
|
|
|
string qualifier = token(3, "None");
|
|
|
|
|
|
|
|
Mapping mapping;
|
|
|
|
for(auto& device : inputManager->devices) {
|
|
|
|
if(id != device->id()) continue;
|
|
|
|
|
|
|
|
mapping.device = device;
|
|
|
|
mapping.group = group;
|
|
|
|
mapping.input = input;
|
|
|
|
mapping.qualifier = Qualifier::None;
|
|
|
|
if(qualifier == "Lo") mapping.qualifier = Qualifier::Lo;
|
|
|
|
if(qualifier == "Hi") mapping.qualifier = Qualifier::Hi;
|
|
|
|
if(qualifier == "Rumble") mapping.qualifier = Qualifier::Rumble;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!mapping.device) continue;
|
|
|
|
mappings.append(mapping);
|
|
|
|
}
|
|
|
|
|
|
|
|
settings[path].setValue(assignment);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputMapping::bind(string mapping) -> void {
|
|
|
|
if(assignment.split(logic() == Logic::AND ? "&" : "|").find(mapping)) return; //ignore if already in mappings list
|
|
|
|
if(!assignment || assignment == "None") { //create new mapping
|
|
|
|
assignment = mapping;
|
|
|
|
} else { //add additional mapping
|
|
|
|
assignment.append(logic() == Logic::AND ? "&" : "|");
|
|
|
|
assignment.append(mapping);
|
|
|
|
}
|
|
|
|
bind();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputMapping::bind(shared_pointer<HID::Device> device, uint group, uint input, int16 oldValue, int16 newValue) -> bool {
|
|
|
|
if(device->isNull() || (device->isKeyboard() && device->group(group).input(input).name() == "Escape")) {
|
|
|
|
return unbind(), true;
|
|
|
|
}
|
|
|
|
|
|
|
|
string encoding = {"0x", hex(device->id()), "/", group, "/", input};
|
|
|
|
|
|
|
|
if(isDigital()) {
|
|
|
|
if((device->isKeyboard() && group == HID::Keyboard::GroupID::Button)
|
|
|
|
|| (device->isMouse() && group == HID::Mouse::GroupID::Button)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Button)) {
|
|
|
|
if(newValue) {
|
|
|
|
return bind(encoding), true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if((device->isJoypad() && group == HID::Joypad::GroupID::Axis)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Hat)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Trigger)) {
|
|
|
|
if(newValue < -16384 && group != HID::Joypad::GroupID::Trigger) { //triggers are always hi
|
|
|
|
return bind({encoding, "/Lo"}), true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(newValue > +16384) {
|
|
|
|
return bind({encoding, "/Hi"}), true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isAnalog()) {
|
|
|
|
if((device->isMouse() && group == HID::Mouse::GroupID::Axis)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Axis)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Hat)) {
|
|
|
|
if(newValue < -16384 || newValue > +16384) {
|
|
|
|
return bind(encoding), true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isRumble()) {
|
|
|
|
if(device->isJoypad() && group == HID::Joypad::GroupID::Button) {
|
|
|
|
if(newValue) {
|
|
|
|
return bind({encoding, "/Rumble"}), true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputMapping::unbind() -> void {
|
|
|
|
mappings.reset();
|
|
|
|
settings[path].setValue(assignment = "None");
|
|
|
|
}
|
|
|
|
|
2018-05-19 02:51:34 +00:00
|
|
|
auto InputMapping::poll() -> int16 {
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
int16 result;
|
|
|
|
|
|
|
|
for(auto& mapping : mappings) {
|
|
|
|
auto& device = mapping.device;
|
|
|
|
auto& group = mapping.group;
|
|
|
|
auto& input = mapping.input;
|
|
|
|
auto& qualifier = mapping.qualifier;
|
|
|
|
auto value = device->group(group).input(input).value();
|
|
|
|
|
|
|
|
if(isDigital()) {
|
|
|
|
boolean output;
|
|
|
|
|
|
|
|
if((device->isKeyboard() && group == HID::Keyboard::GroupID::Button)
|
|
|
|
|| (device->isMouse() && group == HID::Mouse::GroupID::Button)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Button)) {
|
|
|
|
output = value != 0;
|
|
|
|
}
|
|
|
|
if((device->isJoypad() && group == HID::Joypad::GroupID::Axis)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Hat)
|
|
|
|
|| (device->isJoypad() && group == HID::Joypad::GroupID::Trigger)) {
|
|
|
|
if(qualifier == Qualifier::Lo) output = value < -16384;
|
|
|
|
if(qualifier == Qualifier::Hi) output = value > +16384;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(logic() == Logic::AND && output == 0) return 0;
|
|
|
|
if(logic() == Logic::OR && output == 1) return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isAnalog()) {
|
|
|
|
//logic does not apply to analog inputs ... always combinatorial
|
|
|
|
if(device->isMouse() && group == HID::Mouse::GroupID::Axis) result += value;
|
|
|
|
if(device->isJoypad() && group == HID::Joypad::GroupID::Axis) result += value >> 8;
|
|
|
|
if(device->isJoypad() && group == HID::Joypad::GroupID::Hat) result += value < 0 ? -1 : value > 0 ? +1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isDigital() && logic() == Logic::AND) return 1;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputMapping::rumble(bool enable) -> void {
|
|
|
|
for(auto& mapping : mappings) {
|
|
|
|
::input->rumble(mapping.device->id(), enable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputMapping::displayName() -> string {
|
|
|
|
if(!mappings) return "None";
|
|
|
|
|
|
|
|
string path;
|
|
|
|
for(auto& mapping : mappings) {
|
|
|
|
path.append(mapping.device->name());
|
|
|
|
if(mapping.device->name() != "Keyboard" && mapping.device->name() != "Mouse") {
|
|
|
|
//show device IDs to distinguish between multiple joypads
|
|
|
|
path.append("(", hex(mapping.device->id()), ")");
|
|
|
|
}
|
|
|
|
if(mapping.device->name() != "Keyboard") {
|
|
|
|
//keyboards only have one group; no need to append group name
|
|
|
|
path.append(".", mapping.device->group(mapping.group).name());
|
|
|
|
}
|
|
|
|
path.append(".", mapping.device->group(mapping.group).input(mapping.input).name());
|
|
|
|
if(mapping.qualifier == Qualifier::Lo) path.append(".Lo");
|
|
|
|
if(mapping.qualifier == Qualifier::Hi) path.append(".Hi");
|
|
|
|
if(mapping.qualifier == Qualifier::Rumble) path.append(".Rumble");
|
|
|
|
path.append(logic() == Logic::AND ? " and " : " or ");
|
|
|
|
}
|
|
|
|
|
|
|
|
return path.trimRight(logic() == Logic::AND ? " and " : " or ", 1L);
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
InputManager::InputManager() {
|
|
|
|
inputManager = this;
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
input->onChange({&InputManager::onChange, this});
|
|
|
|
frequency = max(1u, settings["Input/Frequency"].natural());
|
2018-05-19 02:51:34 +00:00
|
|
|
|
|
|
|
for(auto& port : emulator->ports) {
|
|
|
|
InputPort inputPort{port.id, port.name};
|
|
|
|
for(auto& device : port.devices) {
|
|
|
|
InputDevice inputDevice{device.id, device.name};
|
|
|
|
for(auto& input : device.inputs) {
|
|
|
|
InputMapping inputMapping;
|
|
|
|
inputMapping.name = input.name;
|
|
|
|
inputMapping.type = input.type;
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
inputMapping.path = string{"Emulator/", inputPort.name, "/", inputDevice.name, "/", inputMapping.name}.replace(" ", "");
|
|
|
|
inputMapping.assignment = settings(inputMapping.path).text();
|
2018-05-19 02:51:34 +00:00
|
|
|
inputDevice.mappings.append(inputMapping);
|
|
|
|
}
|
|
|
|
inputPort.devices.append(inputDevice);
|
|
|
|
}
|
|
|
|
ports.append(inputPort);
|
|
|
|
}
|
|
|
|
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
bindHotkeys();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto InputManager::bind() -> void {
|
|
|
|
for(auto& port : ports) {
|
|
|
|
for(auto& device : port.devices) {
|
|
|
|
for(auto& mapping : device.mappings) {
|
|
|
|
mapping.bind();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for(auto& hotkey : hotkeys) {
|
|
|
|
hotkey.bind();
|
|
|
|
}
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto InputManager::poll() -> void {
|
|
|
|
//polling actual hardware devices is time-consuming; skip if poll was called too recently
|
|
|
|
auto thisPoll = chrono::millisecond();
|
|
|
|
if(thisPoll - lastPoll < frequency) return;
|
|
|
|
lastPoll = thisPoll;
|
|
|
|
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
auto devices = input->poll();
|
|
|
|
bool changed = devices.size() != this->devices.size();
|
|
|
|
if(!changed) {
|
|
|
|
for(auto n : range(devices)) {
|
|
|
|
changed = devices[n] != this->devices[n];
|
|
|
|
if(changed) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(changed) {
|
|
|
|
this->devices = devices;
|
|
|
|
bind();
|
|
|
|
}
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto InputManager::onChange(shared_pointer<HID::Device> device, uint group, uint input, int16_t oldValue, int16_t newValue) -> void {
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
if(settingsWindow->focused()) {
|
|
|
|
settingsWindow->input.inputEvent(device, group, input, oldValue, newValue);
|
|
|
|
settingsWindow->hotkeys.inputEvent(device, group, input, oldValue, newValue);
|
|
|
|
}
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto InputManager::mapping(uint port, uint device, uint input) -> maybe<InputMapping&> {
|
|
|
|
if(!emulator) return nothing;
|
|
|
|
for(auto& inputPort : ports) {
|
|
|
|
if(inputPort.id != port) continue;
|
|
|
|
for(auto& inputDevice : inputPort.devices) {
|
|
|
|
if(inputDevice.id != device) continue;
|
|
|
|
if(input >= inputDevice.mappings.size()) continue;
|
|
|
|
return inputDevice.mappings[input];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nothing;
|
|
|
|
}
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
|
|
|
|
auto InputManager::findMouse() -> shared_pointer<HID::Device> {
|
|
|
|
for(auto& device : devices) {
|
|
|
|
if(device->isMouse()) return device;
|
|
|
|
}
|
|
|
|
return {};
|
|
|
|
}
|