summaryrefslogtreecommitdiff
path: root/common/rawaccel.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-28 02:44:09 -0700
committerJacob Palecki <[email protected]>2020-07-28 02:44:09 -0700
commitb1ef35050600978318581586691f5a8f119abf5b (patch)
tree1a096e8c6d5ceff50ca169fb2295118184d629f5 /common/rawaccel.hpp
parentRemove extra mode from variables (diff)
downloadrawaccel-b1ef35050600978318581586691f5a8f119abf5b.tar.xz
rawaccel-b1ef35050600978318581586691f5a8f119abf5b.zip
Rename variables and add modify functions
Diffstat (limited to 'common/rawaccel.hpp')
-rw-r--r--common/rawaccel.hpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 28d9ee2..9b35568 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -309,14 +309,14 @@ namespace rawaccel {
accel_function() = default;
};
- struct variables {
+ struct mouse_modifier {
bool apply_rotate = false;
bool apply_accel = false;
rotator rotate;
accel_function accel_fn;
vec2d sensitivity = { 1, 1 };
- variables(double degrees, vec2d sens, args_t accel_args)
+ mouse_modifier(double degrees, vec2d sens, args_t accel_args)
: accel_fn(accel_args)
{
apply_rotate = degrees != 0;
@@ -330,7 +330,20 @@ namespace rawaccel {
sensitivity = sens;
}
- variables() = default;
+ vec2d modify(vec2d input)
+ {
+ if (apply_rotate)
+ {
+ return rotate(input);
+ }
+ }
+
+ vec2d modify(vec2d input, milliseconds time)
+ {
+ return accel_fn(modify(input), time);
+ }
+
+ mouse_modifier() = default;
};
} // rawaccel \ No newline at end of file