MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetButtonAxis

Function GetButtonAxis

Source/Engine/Input/Gamepad.cpp:7–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace
6{
7 GamepadAxis GetButtonAxis(GamepadButton button, bool& positive)
8 {
9 positive = true;
10 switch (button)
11 {
12 case GamepadButton::LeftTrigger:
13 return GamepadAxis::LeftTrigger;
14 case GamepadButton::RightTrigger:
15 return GamepadAxis::RightTrigger;
16 case GamepadButton::LeftStickUp:
17 return GamepadAxis::LeftStickY;
18 case GamepadButton::LeftStickDown:
19 positive = false;
20 return GamepadAxis::LeftStickY;
21 case GamepadButton::LeftStickLeft:
22 positive = false;
23 return GamepadAxis::LeftStickX;
24 case GamepadButton::LeftStickRight:
25 return GamepadAxis::LeftStickX;
26 case GamepadButton::RightStickUp:
27 return GamepadAxis::RightStickY;
28 case GamepadButton::RightStickDown:
29 positive = false;
30 return GamepadAxis::RightStickY;
31 case GamepadButton::RightStickLeft:
32 positive = false;
33 return GamepadAxis::RightStickX;
34 case GamepadButton::RightStickRight:
35 return GamepadAxis::RightStickX;
36 default:
37 return GamepadAxis::None;
38 }
39 }
40
41 bool GetButtonState(const Gamepad::State& state, GamepadButton button, float deadZone)
42 {

Callers 1

GetButtonStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected