Shipwright/libultraship/libultraship/WiiUGamepad.h
GaryOderNichts 68e7f2e6c1
Wii U support (#1097)
* Wii U support

* [WiiU] Combined Dockerfile

* [WiiU] Combined Dockerfile

* [WiiU] Combined Dockerfile

* Add Jenkins support

* wiiu: fix scissor clamp

* wiiu: improve button remapping

* wiiu: fix scaling issues

* Update Dockerfile after merge

* Pull assets before build

* Only stop container once

* Adjust logging sinks

* wiiu: Change button mapping to match PC version

* wiiu: Implement controller changes

* wiiu: Update BUILDING.md

Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com>
Co-authored-by: David Chavez <david@dcvz.io>
2022-08-14 22:57:24 -04:00

35 lines
1.1 KiB
C++

#pragma once
#include "Controller.h"
#include <string>
namespace Ship {
class WiiUGamepad : public Controller {
public:
WiiUGamepad();
bool Open();
void Close();
void ReadFromSource(int32_t virtualSlot) override;
void WriteToSource(int32_t virtualSlot, ControllerCallback* controller) override;
bool Connected() const override { return connected; };
bool CanGyro() const override { return true; }
bool CanRumble() const override { return true; };
void ClearRawPress() override;
int32_t ReadRawPress() override;
const std::string GetButtonName(int32_t virtualSlot, int n64Button) override;
const std::string GetControllerName() override;
protected:
void NormalizeStickAxis(int32_t virtualSlot, float x, float y, uint16_t threshold, bool isRightStick);
void CreateDefaultBinding(int32_t virtualSlot) override;
private:
bool connected = true;
float rumblePatternStrength;
uint8_t rumblePattern[15];
};
}