Lioncash d05f490caa ControlGroup/AnalogStick: Return state data by value
Makes it less error-prone to get state data from analog sticks (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
2018-07-13 13:20:31 -04:00

34 lines
740 B
C++

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerInterface/Device.h"
namespace ControllerEmu
{
class AnalogStick : public ControlGroup
{
public:
enum
{
SETTING_RADIUS,
SETTING_DEADZONE,
};
struct StateData
{
ControlState x{};
ControlState y{};
};
// The GameCube controller and Wiimote attachments have a different default radius
AnalogStick(const char* name, ControlState default_radius);
AnalogStick(const char* name, const char* ui_name, ControlState default_radius);
StateData GetState();
};
} // namespace ControllerEmu