Swim pulsing

This commit is contained in:
Adam Whitehurst
2020-01-08 05:17:36 -08:00
parent 8648641362
commit 8cdf06e3e2
3 changed files with 21 additions and 44 deletions

View File

@ -69,6 +69,11 @@ impl Input {
(self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION)
}
// Whether input has been pressed for longer than `threshold`
pub fn is_long_press(&self, threshold: Duration) -> bool {
(self.is_pressed() && self.duration >= threshold)
}
/// Handles logic of updating state of Input
pub fn set_state(&mut self, new_state: bool) {
// Only update if state switches