diff options
| author | a1xd <[email protected]> | 2020-12-05 21:28:08 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-05 21:28:08 -0500 |
| commit | c8503654da5bc40a129e58914549cd394349d059 (patch) | |
| tree | e4760c579597d0e292c7b03dff95d19bb8f3c750 /common/rawaccel.hpp | |
| parent | Merge pull request #45 from JacobPalecki/fix (diff) | |
| parent | update signed, add installers (diff) | |
| download | rawaccel-c8503654da5bc40a129e58914549cd394349d059.tar.xz rawaccel-c8503654da5bc40a129e58914549cd394349d059.zip | |
Merge pull request #46 from a1xd/1.3
Diffstat (limited to 'common/rawaccel.hpp')
| -rw-r--r-- | common/rawaccel.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index b160a42..3e049cb 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 directional_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; + directional_multipliers.x = fabs(args.dir_multipliers.x); + directional_multipliers.y = fabs(args.dir_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 (directional_multipliers.x > 0 && movement.x < 0) { + movement.x *= directional_multipliers.x; + } + if (directional_multipliers.y > 0 && movement.y < 0) { + movement.y *= directional_multipliers.y; + } } mouse_modifier() = default; |