~starkingdoms/starkingdoms

ref: ec496535705de0c88de36c62bb2ef0a9bab3d464 starkingdoms/crates/unified/src/client/input/util.rs -rw-r--r-- 334 bytes
ec496535ghostly_zsh fix: zoom uses projection now 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
use leafwing_input_manager::Actionlike;
use leafwing_input_manager::prelude::ActionState;

pub trait ActionStateExt<A> {
    fn button_changed(&self, a: &A) -> bool;
}
impl<A: Actionlike> ActionStateExt<A> for ActionState<A> {
    fn button_changed(&self, a: &A) -> bool {
        self.just_pressed(a) || self.just_released(a)
    }
}