pub fn poll(&mut self) -> Option<MonomeEvent> {
        match self.q.pop() {
            Some(buf) => self.parse(&buf),
            None => None,
        }
    }
/// Receives a MonomeEvent, from a connected monome, which can be a grid key press, an event
/// from the tilt sensor, or a delta from an encoder, on an Arc. Only the events from the set
/// `prefix` will be received.
///
/// # Example
///
/// ```no_run
/// # extern crate monome;
///
/// use monome::{Monome, MonomeEvent, KeyDirection};
/// let mut m = Monome::new("/prefix").unwrap();
///
/// loop {
///     match m.poll() {
///         Some(MonomeEvent::GridKey{x, y, direction}) => {
///             match direction {
///                 KeyDirection::Down => {
///                     println!("Key pressed: {}x{}", x, y);
///                 }
///                 KeyDirection::Up => {
///                     println!("Key released: {}x{}", x, y);
///                 }
///             }
///         }
///         Some(MonomeEvent::Tilt{n: _n, x, y, z: _z}) => {
///           println!("tilt update: pitch: {}, roll {}", x, y);
///         }
///         _ => {
///           break;
///         }
///     }
/// }
/// ```
Receives a MonomeEvent, from a connected monome, which can be a grid key press, an event
from the tilt sensor, or a delta from an encoder, on an Arc. Only the events from the set
`prefix` will be received.
Receives a MonomeEvent from a connected monome which can be a grid key press an event from the tilt sensor or a delta from an encoder on an Arc . Only the events from the set ` prefix ` will be received .
pub fn poll(&mut self) -> Option<MonomeEvent> {
        match self.q.pop() {
            Some(buf) => self.parse(&buf),
            None => None,
        }
    }
pub fn poll ( & mut self ) -> Option < MonomeEvent > { match self . q . pop ( ) { Some ( buf ) => self . parse ( & buf ) , None => None , } }
Receives a MonomeEvent, from a connected monome, which can be a grid key press, an event
from the tilt sensor, or a delta from an encoder, on an Arc.
Receives a MonomeEvent from a connected monome which can be a grid key press an event from the tilt sensor or a delta from an encoder on an Arc .
&mut self
&mut self
example
None
extern crate monome;
use monome::{Monome, MonomeEvent, KeyDirection};
let mut m = Monome::new("/prefix").unwrap().

loop {
match m.poll() {
Some(MonomeEvent::GridKey{x, y, direction}) => {
match direction {
KeyDirection::Down => {
println!("Key pressed: {}x{}", x, y);
}
KeyDirection::Up => {
println!("Key released: {}x{}", x, y);
}
}
}
Some(MonomeEvent::Tilt{n: _n, x, y, z: _z}) => {
println!("tilt update: pitch: {}, roll {}", x, y);
}
_ => {
break;
}
}
}
```
use monome :: { Monome MonomeEvent KeyDirection } ; let mut m = Monome :: new ( " / prefix " ) . unwrap () . loop { match m . poll () { Some ( MonomeEvent :: GridKey { x y direction } ) = > { match direction { KeyDirection :: Down = > { println! ( " Key pressed : {} x {} " x y ) ; } KeyDirection :: Up = > { println! ( " Key released : {} x {} " x y ) ; } } } Some ( MonomeEvent :: Tilt { n : _n x y z : _z } ) = > { println! ( " tilt update : pitch : {} roll {} " x y ) ; } _ = > { break ; } } } ` ` `