fn update_button(&self, button: Button, state: ButtonState) {
        let mut b = self.buttons.get();

        match button {
            Button::A         => b.a      = state,
            Button::B         => b.b      = state,
            Button::DPadLeft  => b.left   = state,
            Button::DPadRight => b.right  = state,
            Button::DPadUp    => b.up     = state,
            Button::DPadDown  => b.down   = state,
            Button::Start     => b.start  = state,
            Button::Back      => b.select = state,
            _                 => (),
        }

        self.buttons.set(b);
    }
/// Same as update_key but for controller buttons
Same as update_key but for controller buttons
Same as update_key but for controller buttons
fn update_button(&self, button: Button, state: ButtonState) {
        let mut b = self.buttons.get();
        match button {
            Button::A         => b.a      = state,
            Button::B         => b.b      = state,
            Button::DPadLeft  => b.left   = state,
            Button::DPadRight => b.right  = state,
            Button::DPadUp    => b.up     = state,
            Button::DPadDown  => b.down   = state,
            Button::Start     => b.start  = state,
            Button::Back      => b.select = state,
            _                 => (),
        }
        self.buttons.set(b);
    }
fn update_button ( & self , button : Button , state : ButtonState ) { let mut b = self . buttons . get ( ) ; match button { Button :: A => b . a = state , Button :: B => b . b = state , Button :: DPadLeft => b . left = state , Button :: DPadRight => b . right = state , Button :: DPadUp => b . up = state , Button :: DPadDown => b . down = state , Button :: Start => b . start = state , Button :: Back => b . select = state , _ => ( ) , } self . buttons . set ( b ) ; }
Same as update_key but for controller buttons
Same as update_key but for controller buttons
&self
button
Button
state
ButtonState
&self
button
Button
state
ButtonState