1
0

add long-press + notif based mode switching

oooooh boy, this is looking pretty slick. I'm kind-of impressed I was
able to throw this together in ~2 days of post-work hacking (though I
guess they were some pretty late-nights...)

There's really only one feature left that I _need_ to implement, which
is the on-disk persistence for selected mode. That shouldn't be too
tricky though...
This commit is contained in:
Daniel Prilik
2020-10-30 23:39:12 -04:00
parent e6fa6845fe
commit d14a92dfe5
11 changed files with 280 additions and 63 deletions

View File

@@ -3,7 +3,7 @@ use std::sync::mpsc;
use std::thread::JoinHandle;
use std::time::Duration;
use crate::controller::ControlMode;
use crate::controller::{ControlMode, ControlModeMeta};
use crate::dial_device::DialHaptics;
use crate::fake_input::FakeInput;
use crate::DynResult;
@@ -123,6 +123,13 @@ impl DPad {
}
impl ControlMode for DPad {
fn meta(&self) -> ControlModeMeta {
ControlModeMeta {
name: "Paddle",
icon: "input-gaming",
}
}
fn on_start(&mut self, haptics: &DialHaptics) -> DynResult<()> {
haptics.set_mode(false, Some(3600))?;
Ok(())