summaryrefslogtreecommitdiff
path: root/src/tangara/input/input_touch_wheel.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-08-07 12:09:23 +1000
committerjacqueline <me@jacqueline.id.au>2024-08-07 12:09:23 +1000
commit1ff28233bd6a64fab97c56861477e122e4c3eac6 (patch)
treeb5265a93a0e55043f16cefedbb8f9e43e9d18ff7 /src/tangara/input/input_touch_wheel.cpp
parent649cb74f036c392264264d35f98bef1fa4a5a8aa (diff)
downloadtangara-fw-1ff28233bd6a64fab97c56861477e122e4c3eac6.tar.gz
Recalibrate the touchwheel after unlocking
Also power it down whilst we're locked. This saves about half a milliamp.
Diffstat (limited to 'src/tangara/input/input_touch_wheel.cpp')
-rw-r--r--src/tangara/input/input_touch_wheel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tangara/input/input_touch_wheel.cpp b/src/tangara/input/input_touch_wheel.cpp
index b961bb02..a5069ae4 100644
--- a/src/tangara/input/input_touch_wheel.cpp
+++ b/src/tangara/input/input_touch_wheel.cpp
@@ -108,6 +108,15 @@ auto TouchWheel::triggers()
return {centre_, up_, right_, down_, left_};
}
+auto TouchWheel::onLock() -> void {
+ wheel_.LowPowerMode(true);
+}
+
+auto TouchWheel::onUnlock() -> void {
+ wheel_.LowPowerMode(false);
+ wheel_.Recalibrate();
+}
+
auto TouchWheel::sensitivity() -> lua::Property& {
return sensitivity_;
}