Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
navigation_input.h File Reference

Declares controller navigation input handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  input::GamepadAxisDirection { left_stick_up , left_stick_down , left_stick_left , left_stick_right }
 Controller axis directions mapped onto UI navigation commands. More...
 
enum class  input::GamepadButton {
  dpad_up , dpad_down , dpad_left , dpad_right ,
  a , b , x , y ,
  left_shoulder , right_shoulder , start , back
}
 Controller buttons used by the Moonlight client UI. More...
 
enum class  input::KeyboardKey {
  up , down , left , right ,
  enter , escape , backspace , delete_key ,
  space , tab , page_up , page_down ,
  i , m , f3
}
 Keyboard keys mapped onto the same abstract UI commands. More...
 
enum class  input::UiCommand {
  none , move_up , move_down , move_left ,
  move_right , activate , confirm , back ,
  open_context_menu , delete_character , previous_page , next_page ,
  fast_previous_page , fast_next_page , toggle_overlay
}
 Abstract UI command emitted by controller or keyboard input. More...
 

Functions

UiCommand input::map_gamepad_axis_direction_to_ui_command (GamepadAxisDirection direction)
 Map a controller axis direction to a UI command.
 
UiCommand input::map_gamepad_button_to_ui_command (GamepadButton button)
 Map a controller button to a UI command.
 
UiCommand input::map_keyboard_key_to_ui_command (KeyboardKey key, bool shiftPressed=false)
 Map a keyboard key to a UI command.
 

Detailed Description

Declares controller navigation input handling.

Enumeration Type Documentation

◆ GamepadAxisDirection

enum class input::GamepadAxisDirection
strong

Controller axis directions mapped onto UI navigation commands.

Enumerator
left_stick_up 

Left stick moved upward past the navigation threshold.

left_stick_down 

Left stick moved downward past the navigation threshold.

left_stick_left 

Left stick moved left past the navigation threshold.

left_stick_right 

Left stick moved right past the navigation threshold.

◆ GamepadButton

enum class input::GamepadButton
strong

Controller buttons used by the Moonlight client UI.

Enumerator
dpad_up 

D-pad up button.

dpad_down 

D-pad down button.

dpad_left 

D-pad left button.

dpad_right 

D-pad right button.

South face button.

East face button.

West face button.

North face button.

left_shoulder 

Left shoulder button.

right_shoulder 

Right shoulder button.

start 

Start button.

back 

Back button.

◆ KeyboardKey

enum class input::KeyboardKey
strong

Keyboard keys mapped onto the same abstract UI commands.

Enumerator
up 

Up arrow key.

down 

Down arrow key.

left 

Left arrow key.

right 

Right arrow key.

enter 

Enter or return key.

escape 

Escape key.

backspace 

Backspace key.

delete_key 

Delete key.

space 

Space bar.

tab 

Tab key.

page_up 

Page Up key.

page_down 

Page Down key.

Letter I key.

Letter M key.

f3 

F3 function key.

◆ UiCommand

enum class input::UiCommand
strong

Abstract UI command emitted by controller or keyboard input.

Enumerator
none 

No UI action should be performed.

move_up 

Move selection upward.

move_down 

Move selection downward.

move_left 

Move selection left.

move_right 

Move selection right.

activate 

Activate the focused item.

confirm 

Confirm the current action.

back 

Navigate back or cancel.

open_context_menu 

Open the focused item's context menu.

delete_character 

Delete one character from text input.

previous_page 

Move to the previous page.

next_page 

Move to the next page.

fast_previous_page 

Jump backward by a larger page increment.

fast_next_page 

Jump forward by a larger page increment.

toggle_overlay 

Toggle the diagnostics overlay.

Function Documentation

◆ map_gamepad_axis_direction_to_ui_command()

UiCommand input::map_gamepad_axis_direction_to_ui_command ( GamepadAxisDirection direction)

Map a controller axis direction to a UI command.

Parameters
directionController axis direction that crossed the navigation threshold.
Returns
The abstract UI command to process.

◆ map_gamepad_button_to_ui_command()

UiCommand input::map_gamepad_button_to_ui_command ( GamepadButton button)

Map a controller button to a UI command.

Parameters
buttonController button that was pressed.
Returns
The abstract UI command to process.

◆ map_keyboard_key_to_ui_command()

UiCommand input::map_keyboard_key_to_ui_command ( KeyboardKey key,
bool shiftPressed = false )

Map a keyboard key to a UI command.

Parameters
keyKeyboard key that was pressed.
shiftPressedWhether Shift was held for keys such as Tab.
Returns
The abstract UI command to process.