mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-02 06:12:19 -05:00
094388187f
Renames VirtualController to DummyController. Makes controller axis treated the same as buttons. Made Controller class members private or protected Made Controller class treat deadzones, sensitivities, and press thresholds consistently.
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
#pragma once
|
|
#include "Controller.h"
|
|
#include <string>
|
|
|
|
namespace Ship {
|
|
class KeyboardController : public Controller {
|
|
public:
|
|
KeyboardController();
|
|
|
|
void ReadFromSource(int32_t virtualSlot) override;
|
|
void WriteToSource(int32_t virtualSlot, ControllerCallback* controller) override;
|
|
bool Connected() const override { return true; }
|
|
bool CanRumble() const override { return false; }
|
|
bool CanGyro() const override { return false; }
|
|
const std::string GetControllerName() override;
|
|
const std::string GetButtonName(int32_t virtualSlot, int32_t n64Button) override;
|
|
bool PressButton(int32_t dwScancode);
|
|
bool ReleaseButton(int32_t dwScancode);
|
|
|
|
void ClearRawPress() override {
|
|
lastKey = -1;
|
|
}
|
|
|
|
int32_t ReadRawPress() override;
|
|
void ReleaseAllButtons();
|
|
|
|
void SetLastScancode(int32_t key) {
|
|
lastScancode = key;
|
|
}
|
|
|
|
int32_t GetLastScancode() { return lastScancode; }
|
|
void CreateDefaultBinding(int32_t virtualSlot) override;
|
|
|
|
protected:
|
|
int32_t lastScancode;
|
|
int32_t lastKey = -1;
|
|
};
|
|
}
|