pub fn poll_events(&mut self) -> Option<CursesKey> {
    const ERR_U32: u32 = ERR as u32;
    const KEY_F64: u32 = KEY_F0 + 64;
    match (unsafe { wgetch(self.ptr) }) as u32 {
      ERR_U32 => None,
      ascii if (ascii <= u8::MAX as u32) => Some(CursesKey::Ascii(ascii as u8)),
      #[cfg(windows)]
      KEY_A1 => Some(CursesKey::Home),
      #[cfg(windows)]
      KEY_A2 => Some(CursesKey::ArrowUp),
      #[cfg(windows)]
      KEY_A3 => Some(CursesKey::PageUp),
      #[cfg(windows)]
      KEY_B1 => Some(CursesKey::ArrowLeft),
      #[cfg(windows)]
      KEY_B3 => Some(CursesKey::ArrowRight),
      #[cfg(windows)]
      KEY_C1 => Some(CursesKey::End),
      #[cfg(windows)]
      KEY_C2 => Some(CursesKey::ArrowDown),
      #[cfg(windows)]
      KEY_C3 => Some(CursesKey::PageDown),
      #[cfg(windows)]
      PADENTER => Some(CursesKey::Enter),
      #[cfg(windows)]
      PADSLASH => Some(CursesKey::Ascii(b'/')),
      #[cfg(windows)]
      PADSTAR => Some(CursesKey::Ascii(b'*')),
      #[cfg(windows)]
      PADMINUS => Some(CursesKey::Ascii(b'-')),
      #[cfg(windows)]
      PADPLUS => Some(CursesKey::Ascii(b'+')),
      //
      KEY_BACKSPACE => Some(CursesKey::Backspace),
      KEY_UP => Some(CursesKey::ArrowUp),
      KEY_DOWN => Some(CursesKey::ArrowDown),
      KEY_LEFT => Some(CursesKey::ArrowLeft),
      KEY_RIGHT => Some(CursesKey::ArrowRight),
      KEY_IC => Some(CursesKey::Insert),
      KEY_DC => Some(CursesKey::Delete),
      KEY_HOME => Some(CursesKey::Home),
      KEY_END => Some(CursesKey::End),
      KEY_PPAGE => Some(CursesKey::PageUp),
      KEY_NPAGE => Some(CursesKey::PageDown),
      KEY_B2 => Some(CursesKey::Keypad5NoNumlock),
      KEY_RESIZE => {
        unsafe { resize_term(0, 0) };
        Some(CursesKey::TerminalResized)
      }
      KEY_ENTER => Some(CursesKey::Enter),
      //
      f if (f >= KEY_F0 && f <= KEY_F64) => {
        Some(CursesKey::Function((f - KEY_F0) as u8))
      }
      other => Some(CursesKey::UnknownKey(other)),
    }
  }
/// Gets an input event.
///
/// * Ascii keys are returned as their ascii value.
/// * Special keys each have an enum variant of their own.
/// * If the terminal is resized, that shows up as a type of "key".
/// * If you have a timeout set and the time expires, you get `None` back.
Gets an input event.
Ascii keys are returned as their ascii value.
Special keys each have an enum variant of their own.
If the terminal is resized, that shows up as a type of "key".
If you have a timeout set and the time expires, you get `None` back.
Gets an input event . Ascii keys are returned as their ascii value . Special keys each have an enum variant of their own . If the terminal is resized that shows up as a type of " key " . If you have a timeout set and the time expires you get ` None ` back .
pub fn poll_events(&mut self) -> Option<CursesKey> {
    const ERR_U32: u32 = ERR as u32;
    const KEY_F64: u32 = KEY_F0 + 64;
    match (unsafe { wgetch(self.ptr) }) as u32 {
      ERR_U32 => None,
      ascii if (ascii <= u8::MAX as u32) => Some(CursesKey::Ascii(ascii as u8)),
      #[cfg(windows)]
      KEY_A1 => Some(CursesKey::Home),
      #[cfg(windows)]
      KEY_A2 => Some(CursesKey::ArrowUp),
      #[cfg(windows)]
      KEY_A3 => Some(CursesKey::PageUp),
      #[cfg(windows)]
      KEY_B1 => Some(CursesKey::ArrowLeft),
      #[cfg(windows)]
      KEY_B3 => Some(CursesKey::ArrowRight),
      #[cfg(windows)]
      KEY_C1 => Some(CursesKey::End),
      #[cfg(windows)]
      KEY_C2 => Some(CursesKey::ArrowDown),
      #[cfg(windows)]
      KEY_C3 => Some(CursesKey::PageDown),
      #[cfg(windows)]
      PADENTER => Some(CursesKey::Enter),
      #[cfg(windows)]
      PADSLASH => Some(CursesKey::Ascii(b'/')),
      #[cfg(windows)]
      PADSTAR => Some(CursesKey::Ascii(b'*')),
      #[cfg(windows)]
      PADMINUS => Some(CursesKey::Ascii(b'-')),
      #[cfg(windows)]
      PADPLUS => Some(CursesKey::Ascii(b'+')),
      //
      KEY_BACKSPACE => Some(CursesKey::Backspace),
      KEY_UP => Some(CursesKey::ArrowUp),
      KEY_DOWN => Some(CursesKey::ArrowDown),
      KEY_LEFT => Some(CursesKey::ArrowLeft),
      KEY_RIGHT => Some(CursesKey::ArrowRight),
      KEY_IC => Some(CursesKey::Insert),
      KEY_DC => Some(CursesKey::Delete),
      KEY_HOME => Some(CursesKey::Home),
      KEY_END => Some(CursesKey::End),
      KEY_PPAGE => Some(CursesKey::PageUp),
      KEY_NPAGE => Some(CursesKey::PageDown),
      KEY_B2 => Some(CursesKey::Keypad5NoNumlock),
      KEY_RESIZE => {
        unsafe { resize_term(0, 0) };
        Some(CursesKey::TerminalResized)
      }
      KEY_ENTER => Some(CursesKey::Enter),
      //
      f if (f >= KEY_F0 && f <= KEY_F64) => {
        Some(CursesKey::Function((f - KEY_F0) as u8))
      }
      other => Some(CursesKey::UnknownKey(other)),
    }
  }
pub fn poll_events ( & mut self ) -> Option < CursesKey > { const ERR_U32 : u32 = ERR as u32 ; const KEY_F64 : u32 = KEY_F0 + 64 ; match ( unsafe { wgetch ( self . ptr ) } ) as u32 { ERR_U32 => None , ascii if ( ascii <= u8 :: MAX as u32 ) => Some ( CursesKey :: Ascii ( ascii as u8 ) ) , # [ cfg ( windows ) ] KEY_A1 => Some ( CursesKey :: Home ) , # [ cfg ( windows ) ] KEY_A2 => Some ( CursesKey :: ArrowUp ) , # [ cfg ( windows ) ] KEY_A3 => Some ( CursesKey :: PageUp ) , # [ cfg ( windows ) ] KEY_B1 => Some ( CursesKey :: ArrowLeft ) , # [ cfg ( windows ) ] KEY_B3 => Some ( CursesKey :: ArrowRight ) , # [ cfg ( windows ) ] KEY_C1 => Some ( CursesKey :: End ) , # [ cfg ( windows ) ] KEY_C2 => Some ( CursesKey :: ArrowDown ) , # [ cfg ( windows ) ] KEY_C3 => Some ( CursesKey :: PageDown ) , # [ cfg ( windows ) ] PADENTER => Some ( CursesKey :: Enter ) , # [ cfg ( windows ) ] PADSLASH => Some ( CursesKey :: Ascii ( b'/' ) ) , # [ cfg ( windows ) ] PADSTAR => Some ( CursesKey :: Ascii ( b'*' ) ) , # [ cfg ( windows ) ] PADMINUS => Some ( CursesKey :: Ascii ( b'-' ) ) , # [ cfg ( windows ) ] PADPLUS => Some ( CursesKey :: Ascii ( b'+' ) ) , // KEY_BACKSPACE => Some ( CursesKey :: Backspace ) , KEY_UP => Some ( CursesKey :: ArrowUp ) , KEY_DOWN => Some ( CursesKey :: ArrowDown ) , KEY_LEFT => Some ( CursesKey :: ArrowLeft ) , KEY_RIGHT => Some ( CursesKey :: ArrowRight ) , KEY_IC => Some ( CursesKey :: Insert ) , KEY_DC => Some ( CursesKey :: Delete ) , KEY_HOME => Some ( CursesKey :: Home ) , KEY_END => Some ( CursesKey :: End ) , KEY_PPAGE => Some ( CursesKey :: PageUp ) , KEY_NPAGE => Some ( CursesKey :: PageDown ) , KEY_B2 => Some ( CursesKey :: Keypad5NoNumlock ) , KEY_RESIZE => { unsafe { resize_term ( 0 , 0 ) } ; Some ( CursesKey :: TerminalResized ) } KEY_ENTER => Some ( CursesKey :: Enter ) , // f if ( f >= KEY_F0 && f <= KEY_F64 ) => { Some ( CursesKey :: Function ( ( f - KEY_F0 ) as u8 ) ) } other => Some ( CursesKey :: UnknownKey ( other ) ) , } }
Gets an input event.
Gets an input event .
&mut self
&mut self