Move to a global controlmapper

This commit is contained in:
Henrik Rydgård committed 2026-02-12 23:06:26 +01:00
1 parent c5e257635f
commit 734b2a55de
6 files changed
+24 -25

No files matched your search

+5 -5
View File
@@ -480,11 +480,11 @@ void KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) {
}
AnalogCalibrationScreen::AnalogCalibrationScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsCanScroll) {
mapper_.AddListener(this);
g_controlMapper.AddListener(this);
}
AnalogCalibrationScreen::~AnalogCalibrationScreen() {
mapper_.RemoveListener(this);
g_controlMapper.RemoveListener(this);
}
void AnalogCalibrationScreen::SetPSPAnalog(int rotation, int stick, float x, float y) {
@@ -498,7 +498,7 @@ void AnalogCalibrationScreen::SetRawAnalog(int stick, float x, float y) {
}
void AnalogCalibrationScreen::update() {
mapper_.Update(g_Config.GetDisplayLayoutConfig(GetDeviceOrientation()), time_now_d());
g_controlMapper.Update(g_Config.GetDisplayLayoutConfig(GetDeviceOrientation()), time_now_d());
// We ignore the secondary stick for now and just use the two views
// for raw and psp input.
if (stickView_[0]) {
@@ -515,7 +515,7 @@ bool AnalogCalibrationScreen::key(const KeyInput &key) {
// Allow testing auto-rotation. If it collides with UI keys, too bad.
bool pauseTrigger = false;
mapper_.Key(key, &pauseTrigger);
g_controlMapper.Key(key, &pauseTrigger);
if (UI::IsEscapeKey(key)) {
TriggerFinish(DR_BACK);
@@ -529,7 +529,7 @@ void AnalogCalibrationScreen::axis(const AxisInput &axis) {
// UIScreen::axis(axis);
// Instead we just send the input directly to the mapper, that we'll visualize.
mapper_.Axis(&axis, 1);
g_controlMapper.Axis(&axis, 1);
}
std::string_view AnalogCalibrationScreen::GetTitle() const {