pub fn process_keyboard_input(&mut self, input: KeyboardInput) -> bool {
        let previous_state = self.keys.get(&input.scancode).cloned();
        self.keys.insert(input.scancode, input.state);
        if let &Some(ElementState::Pressed) = &previous_state {
            if input.scancode == TOGGLE_FLIGHT {
                self.flying = !self.flying;
            }
            if input.scancode == TOGGLE_CULLING {
                self.enable_culling = !self.enable_culling;
                send_debug_info(
                    "Render",
                    "chunkculling",
                    format!(
                        "Chunk culling is {}enabled",
                        if self.enable_culling { "" } else { "not " }
                    ),
                );
            }
        }
        previous_state != Some(input.state)
    }
/// Process a keyboard input, returning whether the state of the key changed or not
Process a keyboard input, returning whether the state of the key changed or not
Process a keyboard input returning whether the state of the key changed or not
pub fn process_keyboard_input(&mut self, input: KeyboardInput) -> bool {
        let previous_state = self.keys.get(&input.scancode).cloned();
        self.keys.insert(input.scancode, input.state);
        if let &Some(ElementState::Pressed) = &previous_state {
            if input.scancode == TOGGLE_FLIGHT {
                self.flying = !self.flying;
            }
            if input.scancode == TOGGLE_CULLING {
                self.enable_culling = !self.enable_culling;
                send_debug_info(
                    "Render",
                    "chunkculling",
                    format!(
                        "Chunk culling is {}enabled",
                        if self.enable_culling { "" } else { "not " }
                    ),
                );
            }
        }
        previous_state != Some(input.state)
    }
pub fn process_keyboard_input ( & mut self , input : KeyboardInput ) -> bool { let previous_state = self . keys . get ( & input . scancode ) . cloned ( ) ; self . keys . insert ( input . scancode , input . state ) ; if let & Some ( ElementState :: Pressed ) = & previous_state { if input . scancode == TOGGLE_FLIGHT { self . flying = ! self . flying ; } if input . scancode == TOGGLE_CULLING { self . enable_culling = ! self . enable_culling ; send_debug_info ( " " , " " , format ! ( " " if self enable_culling { " " } else { " " } ) , ) ; } } previous_state != Some ( input . state ) }
Process a keyboard input, returning whether the state of the key changed or not
Process a keyboard input returning whether the state of the key changed or not
&mut self
input
KeyboardInput
&mut self
input
KeyboardInput