Files
devilutionX/SourceX/controls/controller_motion.h
T
Gleb Mazovetskiy 693e189025 Controller: Fix L2/R2 handling
Broken in https://github.com/diasurgical/devilutionX/commit/01401a16c70213db7a9a84196dee354a2ebc11a3

`ToControllerButtonEvent` must only be called once per SDL event because
of how it handled L2/R2
2020-11-28 17:58:55 +01:00

23 lines
690 B
C++

#pragma once
// Processes and stores mouse and joystick motion.
#include "all.h"
#include "controls/controller.h"
namespace dvl {
// Raw axis values.
extern float leftStickXUnscaled, leftStickYUnscaled, rightStickXUnscaled, rightStickYUnscaled;
// Axis values scaled to [-1, 1] range and clamped to a deadzone.
extern float leftStickX, leftStickY, rightStickX, rightStickY;
// Whether stick positions have been updated and need rescaling.
extern bool leftStickNeedsScaling, rightStickNeedsScaling;
// Updates motion state for mouse and joystick sticks.
bool ProcessControllerMotion(const SDL_Event &event, ControllerButtonEvent ctrl_event);
} // namespace dvl