Skip to content

Commit

Permalink
Add access to pressed/just_pressed/just_released to Input<T> (bevyeng…
Browse files Browse the repository at this point in the history
…ine#428)

Add access to pressed/just_pressed to Input<T>
  • Loading branch information
TheNeikos authored and mrk-its committed Oct 6, 2020
1 parent c7e80f3 commit cfc77a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/bevy_input/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@ where
self.just_pressed.clear();
self.just_released.clear();
}

pub fn get_pressed(&self) -> impl ExactSizeIterator<Item = &T> {
self.pressed.iter()
}

pub fn get_just_pressed(&self) -> impl ExactSizeIterator<Item = &T> {
self.just_pressed.iter()
}

pub fn get_just_released(&self) -> impl ExactSizeIterator<Item = &T> {
self.just_released.iter()
}
}

0 comments on commit cfc77a2

Please sign in to comment.