Skip to content

Commit

Permalink
Add get_device_mouse_flip_*, set_device_mouse_flip_*
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Sep 20, 2023
1 parent 7c07928 commit 5025c20
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions src/share/core_configuration/details/profile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,90 @@ class profile final {
}
}

bool get_device_mouse_flip_x(const device_identifiers& identifiers) const {
for (const auto& d : devices_) {
if (d.get_identifiers() == identifiers) {
return d.get_mouse_flip_x();
}
}
return false;
}

void set_device_mouse_flip_x(const device_identifiers& identifiers,
bool value) {
add_device(identifiers);

for (auto&& device : devices_) {
if (device.get_identifiers() == identifiers) {
device.set_mouse_flip_x(value);
return;
}
}
}

bool get_device_mouse_flip_y(const device_identifiers& identifiers) const {
for (const auto& d : devices_) {
if (d.get_identifiers() == identifiers) {
return d.get_mouse_flip_y();
}
}
return false;
}

void set_device_mouse_flip_y(const device_identifiers& identifiers,
bool value) {
add_device(identifiers);

for (auto&& device : devices_) {
if (device.get_identifiers() == identifiers) {
device.set_mouse_flip_y(value);
return;
}
}
}

bool get_device_mouse_flip_vertical_wheel(const device_identifiers& identifiers) const {
for (const auto& d : devices_) {
if (d.get_identifiers() == identifiers) {
return d.get_mouse_flip_vertical_wheel();
}
}
return false;
}

void set_device_mouse_flip_vertical_wheel(const device_identifiers& identifiers,
bool value) {
add_device(identifiers);

for (auto&& device : devices_) {
if (device.get_identifiers() == identifiers) {
device.set_mouse_flip_vertical_wheel(value);
return;
}
}
}

bool get_device_mouse_flip_horizontal_wheel(const device_identifiers& identifiers) const {
for (const auto& d : devices_) {
if (d.get_identifiers() == identifiers) {
return d.get_mouse_flip_horizontal_wheel();
}
}
return false;
}

void set_device_mouse_flip_horizontal_wheel(const device_identifiers& identifiers,
bool value) {
add_device(identifiers);

for (auto&& device : devices_) {
if (device.get_identifiers() == identifiers) {
device.set_mouse_flip_horizontal_wheel(value);
return;
}
}
}

private:
void add_device(const device_identifiers& identifiers) {
for (auto&& device : devices_) {
Expand Down

0 comments on commit 5025c20

Please sign in to comment.