mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
InputCommon: Decouple ButtonManager and Touchscreen from Android
Changes were also made for codestyle compliance.
This commit is contained in:
@ -4,66 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
#include "jni/ButtonManager.h"
|
||||
|
||||
namespace ciface::Android
|
||||
{
|
||||
void SetMotionSensorsEnabled(bool accelerometer_enabled, bool gyroscope_enabled);
|
||||
|
||||
void PopulateDevices();
|
||||
|
||||
class Touchscreen : public Core::Device
|
||||
{
|
||||
private:
|
||||
class Button : public Input
|
||||
{
|
||||
public:
|
||||
std::string GetName() const;
|
||||
Button(int padID, ButtonManager::ButtonType index) : _padID(padID), _index(index) {}
|
||||
ControlState GetState() const;
|
||||
|
||||
private:
|
||||
const int _padID;
|
||||
const ButtonManager::ButtonType _index;
|
||||
};
|
||||
class Axis : public Input
|
||||
{
|
||||
public:
|
||||
std::string GetName() const;
|
||||
bool IsDetectable() override { return false; }
|
||||
Axis(int padID, ButtonManager::ButtonType index, float neg = 1.0f)
|
||||
: _padID(padID), _index(index), _neg(neg)
|
||||
{
|
||||
}
|
||||
ControlState GetState() const;
|
||||
|
||||
private:
|
||||
const int _padID;
|
||||
const ButtonManager::ButtonType _index;
|
||||
const float _neg;
|
||||
};
|
||||
class Motor : public Core::Device::Output
|
||||
{
|
||||
public:
|
||||
Motor(int padID, ButtonManager::ButtonType index) : _padID(padID), _index(index) {}
|
||||
~Motor();
|
||||
std::string GetName() const override;
|
||||
void SetState(ControlState state) override;
|
||||
|
||||
private:
|
||||
const int _padID;
|
||||
const ButtonManager::ButtonType _index;
|
||||
static void Rumble(int padID, double state);
|
||||
};
|
||||
|
||||
public:
|
||||
Touchscreen(int padID);
|
||||
~Touchscreen() {}
|
||||
std::string GetName() const;
|
||||
std::string GetSource() const;
|
||||
|
||||
private:
|
||||
const int _padID;
|
||||
};
|
||||
} // namespace ciface::Android
|
||||
|
Reference in New Issue
Block a user