summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/rawaccel-settings.h1
-rw-r--r--common/rawaccel.hpp13
2 files changed, 13 insertions, 1 deletions
diff --git a/common/rawaccel-settings.h b/common/rawaccel-settings.h
index e9e158c..0f52807 100644
--- a/common/rawaccel-settings.h
+++ b/common/rawaccel-settings.h
@@ -21,6 +21,7 @@ namespace rawaccel {
vec2<accel_mode> modes = { accel_mode::noaccel, accel_mode::noaccel };
vec2<accel_args> argsv;
vec2d sens = { 1, 1 };
+ vec2d neg_multipliers = {};
milliseconds time_min = DEFAULT_TIME_MIN;
};
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index b160a42..a7b9144 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -233,6 +233,7 @@ namespace rawaccel {
rotator rotate;
vec2<accelerator> accels;
vec2d sensitivity = { 1, 1 };
+ vec2d negative_multipliers = {};
mouse_modifier(const settings& args, vec2<si_pair*> luts = {}) :
combine_magnitudes(args.combine_mags)
@@ -245,6 +246,9 @@ namespace rawaccel {
if (args.sens.x != 0) sensitivity.x = args.sens.x;
if (args.sens.y != 0) sensitivity.y = args.sens.y;
+ negative_multipliers.x = fabs(args.neg_multipliers.x);
+ negative_multipliers.y = fabs(args.neg_multipliers.y);
+
if ((combine_magnitudes && args.modes.x == accel_mode::noaccel) ||
(args.modes.x == accel_mode::noaccel &&
args.modes.y == accel_mode::noaccel)) {
@@ -285,9 +289,16 @@ namespace rawaccel {
}
}
- inline void apply_sensitivity(vec2d& movement) {
+ inline void apply_sensitivity(vec2d& movement) {
movement.x *= sensitivity.x;
movement.y *= sensitivity.y;
+
+ if (negative_multipliers.x > 0 && movement.x < 0) {
+ movement.x *= negative_multipliers.x;
+ }
+ if (negative_multipliers.y > 0 && movement.y < 0) {
+ movement.y *= negative_multipliers.y;
+ }
}
mouse_modifier() = default;