fn virtual_keycode_to_controller_input(keycode: &VirtualKeyCode) -> Result<ControllerInput, ()> {
    match keycode {
        VirtualKeyCode::X => Ok(ControllerInput::A),
        VirtualKeyCode::Z => Ok(ControllerInput::B),
        VirtualKeyCode::S => Ok(ControllerInput::START),
        VirtualKeyCode::A => Ok(ControllerInput::SELECT),
        VirtualKeyCode::Down => Ok(ControllerInput::DOWN),
        VirtualKeyCode::Left => Ok(ControllerInput::LEFT),
        VirtualKeyCode::Right => Ok(ControllerInput::RIGHT),
        VirtualKeyCode::Up => Ok(ControllerInput::UP),
        _ => Err(()),
    }
}
// This maps the keyboard input to a controller input
This maps the keyboard input to a controller input
This maps the keyboard input to a controller input
fn virtual_keycode_to_controller_input(keycode: &VirtualKeyCode) -> Result<ControllerInput, ()> {
    match keycode {
        VirtualKeyCode::X => Ok(ControllerInput::A),
        VirtualKeyCode::Z => Ok(ControllerInput::B),
        VirtualKeyCode::S => Ok(ControllerInput::START),
        VirtualKeyCode::A => Ok(ControllerInput::SELECT),
        VirtualKeyCode::Down => Ok(ControllerInput::DOWN),
        VirtualKeyCode::Left => Ok(ControllerInput::LEFT),
        VirtualKeyCode::Right => Ok(ControllerInput::RIGHT),
        VirtualKeyCode::Up => Ok(ControllerInput::UP),
        _ => Err(()),
    }
}
fn virtual_keycode_to_controller_input ( keycode : & VirtualKeyCode ) -> Result < ControllerInput , ( ) > { match keycode { VirtualKeyCode :: X => Ok ( ControllerInput :: A ) , VirtualKeyCode :: Z => Ok ( ControllerInput :: B ) , VirtualKeyCode :: S => Ok ( ControllerInput :: START ) , VirtualKeyCode :: A => Ok ( ControllerInput :: SELECT ) , VirtualKeyCode :: Down => Ok ( ControllerInput :: DOWN ) , VirtualKeyCode :: Left => Ok ( ControllerInput :: LEFT ) , VirtualKeyCode :: Right => Ok ( ControllerInput :: RIGHT ) , VirtualKeyCode :: Up => Ok ( ControllerInput :: UP ) , _ => Err ( ( ) ) , } }
This maps the keyboard input to a controller input
This maps the keyboard input to a controller input
keycode
&VirtualKeyCode
keycode
&VirtualKeyCode