pub fn default_keyboard_input(
    keyboard: Res<Input<KeyCode>>,
    input_mapping: Res<InputMapping>,
    mut nav_cmds: EventWriter<NavRequest>,
) {
    use Direction::*;
    use NavRequest::*;

    let command_mapping = mapping! {
        input_mapping.key_action => Action,
        input_mapping.key_cancel => Cancel,
        input_mapping.key_up => Move(North),
        input_mapping.key_down => Move(South),
        input_mapping.key_left => Move(West),
        input_mapping.key_right => Move(East),
        input_mapping.key_up_alt => Move(North),
        input_mapping.key_down_alt => Move(South),
        input_mapping.key_left_alt => Move(West),
        input_mapping.key_right_alt => Move(East),
        input_mapping.key_next => ScopeMove(ScopeDirection::Next),
        input_mapping.key_next_alt => ScopeMove(ScopeDirection::Next),
        input_mapping.key_previous => ScopeMove(ScopeDirection::Previous)
    };
    for (key, request) in command_mapping {
        if keyboard.just_pressed(key) {
            nav_cmds.send(request)
        }
    }
}
/// A system to send keyboard control events to the focus system
///
/// supports `WASD` and arrow keys for the directions, `E`, `Q` and `Tab` for
/// scopped menus, `Backspace` and `Enter` for cancel and selection
///
/// The button mapping may be controlled through the [`InputMapping`] resource.
/// You may however need to customize the behavior of this system (typically
/// when integrating in the game) in this case, you should write your own
/// system that sends [`NavRequest`](crate::NavRequest) events


The button mapping may be controlled through the [`InputMapping`] resource.
You may however need to customize the behavior of this system (typically
when integrating in the game) in this case, you should write your own
system that sends [`NavRequest`](crate::NavRequest) events
The button mapping may be controlled through the [ ` InputMapping ` ] resource . You may however need to customize the behavior of this system ( typically when integrating in the game ) in this case you should write your own system that sends [ ` NavRequest ` ] ( crate :: NavRequest ) events
pub fn default_keyboard_input(
    keyboard: Res<Input<KeyCode>>,
    input_mapping: Res<InputMapping>,
    mut nav_cmds: EventWriter<NavRequest>,
) {
    use Direction::*;
    use NavRequest::*;
    let command_mapping = mapping! {
        input_mapping.key_action => Action,
        input_mapping.key_cancel => Cancel,
        input_mapping.key_up => Move(North),
        input_mapping.key_down => Move(South),
        input_mapping.key_left => Move(West),
        input_mapping.key_right => Move(East),
        input_mapping.key_up_alt => Move(North),
        input_mapping.key_down_alt => Move(South),
        input_mapping.key_left_alt => Move(West),
        input_mapping.key_right_alt => Move(East),
        input_mapping.key_next => ScopeMove(ScopeDirection::Next),
        input_mapping.key_next_alt => ScopeMove(ScopeDirection::Next),
        input_mapping.key_previous => ScopeMove(ScopeDirection::Previous)
    };
    for (key, request) in command_mapping {
        if keyboard.just_pressed(key) {
            nav_cmds.send(request)
        }
    }
}
pub fn default_keyboard_input ( keyboard : Res < Input < KeyCode > > , input_mapping : Res < InputMapping > , mut nav_cmds : EventWriter < NavRequest > , ) { use Direction :: * ; use NavRequest :: * ; let command_mapping = mapping ! { input_mapping key_action Action input_mapping key_cancel Cancel input_mapping key_up Move ( North ) input_mapping key_down Move ( South ) input_mapping key_left Move ( West ) input_mapping key_right Move ( East ) input_mapping key_up_alt Move ( North ) input_mapping key_down_alt Move ( South ) input_mapping key_left_alt Move ( West ) input_mapping key_right_alt Move ( East ) input_mapping key_next ScopeMove ( ScopeDirection Next ) input_mapping key_next_alt ScopeMove ( ScopeDirection Next ) input_mapping key_previous ScopeMove ( ScopeDirection Previous ) } ; for ( key , request ) in command_mapping { if keyboard . just_pressed ( key ) { nav_cmds . send ( request ) } } }
A system to send keyboard control events to the focus system
supports `WASD` and arrow keys for the directions, `E`, `Q` and `Tab` for
scopped menus, `Backspace` and `Enter` for cancel and selection
A system to send keyboard control events to the focus system supports ` WASD ` and arrow keys for the directions ` E ` ` Q ` and ` Tab ` for scopped menus ` Backspace ` and ` Enter ` for cancel and selection
keyboard
Res<Input<KeyCode>>
input_mapping
Res<InputMapping>
nav_cmds
EventWriter<NavRequest>
keyboard
Res<Input<KeyCode>>
input_mapping
Res<InputMapping>
nav_cmds
EventWriter<NavRequest>