fn process_key_bindings(&mut self, input: KeyboardInput) {
        let mut suppress_chars = None;

        for i in 0..self.ctx.config().ui_config.key_bindings.len() {
            let binding = &self.ctx.config().ui_config.key_bindings[i];

            let key = match (binding.trigger, input.virtual_keycode) {
                (Key::Scancode(_), _) => Key::Scancode(input.scancode),
                (_, Some(key)) => Key::from_glutin_input(key),
                _ => continue,
            };

            if binding.is_triggered_by(*self.ctx.terminal().mode(), input.modifiers, &key, false) {
                // Binding was triggered; run the action
                let binding = binding.clone();
                binding.execute(&mut self.ctx, false);

                // Don't suppress when there has been a `ReceiveChar` action
                *suppress_chars.get_or_insert(true) &= binding.action != Action::ReceiveChar;
            }
        }

        // Don't suppress char if no bindings were triggered
        *self.ctx.suppress_chars() = suppress_chars.unwrap_or(false);
    }
/// Attempt to find a binding and execute its action.
///
/// The provided mode, mods, and key must match what is allowed by a binding
/// for its action to be executed.
Attempt to find a binding and execute its action.
The provided mode, mods, and key must match what is allowed by a binding
for its action to be executed.
Attempt to find a binding and execute its action . The provided mode mods and key must match what is allowed by a binding for its action to be executed .
fn process_key_bindings(&mut self, input: KeyboardInput) {
        let mut suppress_chars = None;
        for i in 0..self.ctx.config().ui_config.key_bindings.len() {
            let binding = &self.ctx.config().ui_config.key_bindings[i];
            let key = match (binding.trigger, input.virtual_keycode) {
                (Key::Scancode(_), _) => Key::Scancode(input.scancode),
                (_, Some(key)) => Key::from_glutin_input(key),
                _ => continue,
            };
            if binding.is_triggered_by(*self.ctx.terminal().mode(), input.modifiers, &key, false) {
                // Binding was triggered; run the action
                let binding = binding.clone();
                binding.execute(&mut self.ctx, false);
                // Don't suppress when there has been a `ReceiveChar` action
                *suppress_chars.get_or_insert(true) &= binding.action != Action::ReceiveChar;
            }
        }
        // Don't suppress char if no bindings were triggered
        *self.ctx.suppress_chars() = suppress_chars.unwrap_or(false);
    }
fn process_key_bindings ( & mut self , input : KeyboardInput ) { let mut suppress_chars = None ; for i in 0 .. self . ctx . config ( ) . ui_config . key_bindings . len ( ) { let binding = & self . ctx . config ( ) . ui_config . key_bindings [ i ] ; let key = match ( binding . trigger , input . virtual_keycode ) { ( Key :: Scancode ( _ ) , _ ) => Key :: Scancode ( input . scancode ) , ( _ , Some ( key ) ) => Key :: from_glutin_input ( key ) , _ => continue , } ; if binding . is_triggered_by ( * self . ctx . terminal ( ) . mode ( ) , input . modifiers , & key , false ) { // Binding was triggered; run the action let binding = binding . clone ( ) ; binding . execute ( & mut self . ctx , false ) ; // Don't suppress when there has been a `ReceiveChar` action * suppress_chars . get_or_insert ( true ) &= binding . action != Action :: ReceiveChar ; } } // Don't suppress char if no bindings were triggered * self . ctx . suppress_chars ( ) = suppress_chars . unwrap_or ( false ) ; }
Attempt to find a binding and execute its action.
Attempt to find a binding and execute its action .
&mut self
input
KeyboardInput
&mut self
input
KeyboardInput