second commit lion review
This commit is contained in:
parent
730f078302
commit
77fa4d4bf6
28 changed files with 73 additions and 42 deletions
|
@ -7,6 +7,12 @@
|
|||
|
||||
namespace InputCommon {
|
||||
|
||||
constexpr PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
|
||||
Keyboard::Keyboard(const std::string& input_engine_) : InputEngine(input_engine_) {
|
||||
PreSetController(identifier);
|
||||
}
|
||||
|
|
|
@ -32,13 +32,6 @@ public:
|
|||
|
||||
/// Used for automapping features
|
||||
std::vector<Common::ParamPackage> GetInputDevices() const override;
|
||||
|
||||
private:
|
||||
const PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
|
@ -14,6 +14,11 @@
|
|||
namespace InputCommon {
|
||||
constexpr int touch_axis_x = 10;
|
||||
constexpr int touch_axis_y = 11;
|
||||
constexpr PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
|
||||
Mouse::Mouse(const std::string input_engine_) : InputEngine(input_engine_) {
|
||||
PreSetController(identifier);
|
||||
|
|
|
@ -62,11 +62,6 @@ private:
|
|||
void UpdateThread(std::stop_token stop_token);
|
||||
void StopPanning();
|
||||
|
||||
const PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
Common::Vec2<int> mouse_origin;
|
||||
Common::Vec2<int> last_mouse_position;
|
||||
Common::Vec2<float> last_mouse_change;
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
|
||||
namespace InputCommon {
|
||||
|
||||
constexpr PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
|
||||
TouchScreen::TouchScreen(const std::string input_engine_) : InputEngine(input_engine_) {
|
||||
PreSetController(identifier);
|
||||
}
|
||||
|
|
|
@ -37,14 +37,8 @@ public:
|
|||
*/
|
||||
void TouchReleased(std::size_t finger);
|
||||
|
||||
/// Resets all inputs to their initial value
|
||||
void ReleaseAllTouch();
|
||||
|
||||
private:
|
||||
const PadIdentifier identifier = {
|
||||
.guid = Common::UUID{Common::INVALID_UUID},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
|
@ -353,11 +353,12 @@ void InputEngine::SetMappingCallback(MappingCallback callback) {
|
|||
|
||||
void InputEngine::DeleteCallback(int key) {
|
||||
std::lock_guard lock{mutex_callback};
|
||||
if (!callback_list.contains(key)) {
|
||||
const auto& iterator = callback_list.find(key);
|
||||
if (iterator == callback_list.end()) {
|
||||
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
|
||||
return;
|
||||
}
|
||||
callback_list.erase(key);
|
||||
callback_list.erase(iterator);
|
||||
}
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue