pub fn event<E: GenericEvent>(&mut self, e: &E) {
        if let Some(button) = e.press_args() {
            match button {
                Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.insert(ModifierKey::CTRL),
                Button::Keyboard(Key::LShift | Key::RShift) => self.insert(ModifierKey::SHIFT),
                Button::Keyboard(Key::LAlt | Key::RAlt) => self.insert(ModifierKey::ALT),
                Button::Keyboard(Key::LGui | Key::RGui) => self.insert(ModifierKey::GUI),
                _ => {}
            }
        }
        if let Some(button) = e.release_args() {
            match button {
                Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.remove(ModifierKey::CTRL),
                Button::Keyboard(Key::LShift | Key::RShift) => self.remove(ModifierKey::SHIFT),
                Button::Keyboard(Key::LAlt | Key::RAlt) => self.remove(ModifierKey::ALT),
                Button::Keyboard(Key::LGui | Key::RGui) => self.remove(ModifierKey::GUI),
                _ => {}
            }
        }
        if let Some(false) = e.focus_args() {
            *self = ModifierKey::NO_MODIFIER;
        }
    }
/// Change modifier key state depending on input.
///
/// If the left or side button is released, it counts as a release.
Change modifier key state depending on input.
If the left or side button is released, it counts as a release.
Change modifier key state depending on input . If the left or side button is released it counts as a release .
pub fn event<E: GenericEvent>(&mut self, e: &E) {
        if let Some(button) = e.press_args() {
            match button {
                Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.insert(ModifierKey::CTRL),
                Button::Keyboard(Key::LShift | Key::RShift) => self.insert(ModifierKey::SHIFT),
                Button::Keyboard(Key::LAlt | Key::RAlt) => self.insert(ModifierKey::ALT),
                Button::Keyboard(Key::LGui | Key::RGui) => self.insert(ModifierKey::GUI),
                _ => {}
            }
        }
        if let Some(button) = e.release_args() {
            match button {
                Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.remove(ModifierKey::CTRL),
                Button::Keyboard(Key::LShift | Key::RShift) => self.remove(ModifierKey::SHIFT),
                Button::Keyboard(Key::LAlt | Key::RAlt) => self.remove(ModifierKey::ALT),
                Button::Keyboard(Key::LGui | Key::RGui) => self.remove(ModifierKey::GUI),
                _ => {}
            }
        }
        if let Some(false) = e.focus_args() {
            *self = ModifierKey::NO_MODIFIER;
        }
    }
pub fn event < E : GenericEvent > ( & mut self , e : & E ) { if let Some ( button ) = e . press_args ( ) { match button { Button :: Keyboard ( Key :: LCtrl | Key :: RCtrl ) => self . insert ( ModifierKey :: CTRL ) , Button :: Keyboard ( Key :: LShift | Key :: RShift ) => self . insert ( ModifierKey :: SHIFT ) , Button :: Keyboard ( Key :: LAlt | Key :: RAlt ) => self . insert ( ModifierKey :: ALT ) , Button :: Keyboard ( Key :: LGui | Key :: RGui ) => self . insert ( ModifierKey :: GUI ) , _ => { } } } if let Some ( button ) = e . release_args ( ) { match button { Button :: Keyboard ( Key :: LCtrl | Key :: RCtrl ) => self . remove ( ModifierKey :: CTRL ) , Button :: Keyboard ( Key :: LShift | Key :: RShift ) => self . remove ( ModifierKey :: SHIFT ) , Button :: Keyboard ( Key :: LAlt | Key :: RAlt ) => self . remove ( ModifierKey :: ALT ) , Button :: Keyboard ( Key :: LGui | Key :: RGui ) => self . remove ( ModifierKey :: GUI ) , _ => { } } } if let Some ( false ) = e . focus_args ( ) { * self = ModifierKey :: NO_MODIFIER ; } }
Change modifier key state depending on input.
Change modifier key state depending on input .
&mut self
e
&E
&mut self
e
&E