pub struct Controller {
pub down: HashSet<Key>,
pub buttons: u8,
}Expand description
Main controller device for the Varvara system.
Fields§
§down: HashSet<Key>Keys that are currently held down
Current button state
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn pressed(
&mut self,
vm: &mut Uxn<'_>,
k: Key,
repeat: bool,
) -> Option<Event>
pub fn pressed( &mut self, vm: &mut Uxn<'_>, k: Key, repeat: bool, ) -> Option<Event>
Send the given key event, returning an event if needed
Sourcepub fn released(&mut self, vm: &mut Uxn<'_>, k: Key) -> Option<Event>
pub fn released(&mut self, vm: &mut Uxn<'_>, k: Key) -> Option<Event>
Indicate that the given key has been released
This may change our button state and return an event
Checks the current button states and returns an event if any button state changed.
Trait Implementations§
Source§impl ControllerDevice for Controller
impl ControllerDevice for Controller
Source§impl Default for Controller
impl Default for Controller
Source§fn default() -> Controller
fn default() -> Controller
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnsafeUnpin for Controller
impl UnwindSafe for Controller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more