InputManager: Remove unused pointer type

This commit is contained in:
Stenzek 2024-08-24 14:23:32 +10:00
parent 413b17482b
commit 9c77aac295
No known key found for this signature in database
7 changed files with 9 additions and 12 deletions

View file

@ -273,7 +273,7 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
} }
// clang-format off // clang-format off
{"Pointer", TRANSLATE_NOOP("GunCon", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast<u32>(GunCon::Binding::ButtonCount), InputBindingInfo::Type::AbsolutePointer, GenericInputBinding::Unknown}, {"Pointer", TRANSLATE_NOOP("GunCon", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast<u32>(GunCon::Binding::ButtonCount), InputBindingInfo::Type::Pointer, GenericInputBinding::Unknown},
BUTTON("Trigger", TRANSLATE_NOOP("GunCon", "Trigger"), ICON_PF_CROSS, GunCon::Binding::Trigger, GenericInputBinding::R2), BUTTON("Trigger", TRANSLATE_NOOP("GunCon", "Trigger"), ICON_PF_CROSS, GunCon::Binding::Trigger, GenericInputBinding::R2),
BUTTON("ShootOffscreen", TRANSLATE_NOOP("GunCon", "Shoot Offscreen"), nullptr, GunCon::Binding::ShootOffscreen, GenericInputBinding::L2), BUTTON("ShootOffscreen", TRANSLATE_NOOP("GunCon", "Shoot Offscreen"), nullptr, GunCon::Binding::ShootOffscreen, GenericInputBinding::L2),
BUTTON("A", TRANSLATE_NOOP("GunCon", "A"), ICON_PF_BUTTON_A, GunCon::Binding::A, GenericInputBinding::Cross), BUTTON("A", TRANSLATE_NOOP("GunCon", "A"), ICON_PF_BUTTON_A, GunCon::Binding::A, GenericInputBinding::Cross),

View file

@ -15,8 +15,7 @@ struct InputBindingInfo
Axis, Axis,
HalfAxis, HalfAxis,
Motor, Motor,
Pointer, // Receive relative mouse movement events, bind_index is offset by the axis. Pointer, // Receive relative mouse movement events, bind_index is offset by the axis.
AbsolutePointer, // Allows selection of specific pointers, but defaults to the first.
Macro, Macro,
}; };

View file

@ -336,7 +336,7 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
} }
// clang-format off // clang-format off
{"Pointer", TRANSLATE_NOOP("Justifier", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast<u32>(Justifier::Binding::ButtonCount), InputBindingInfo::Type::AbsolutePointer, GenericInputBinding::Unknown}, {"Pointer", TRANSLATE_NOOP("Justifier", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast<u32>(Justifier::Binding::ButtonCount), InputBindingInfo::Type::Pointer, GenericInputBinding::Unknown},
BUTTON("Trigger", TRANSLATE_NOOP("Justifier", "Trigger"), ICON_PF_CROSS, Justifier::Binding::Trigger, GenericInputBinding::R2), BUTTON("Trigger", TRANSLATE_NOOP("Justifier", "Trigger"), ICON_PF_CROSS, Justifier::Binding::Trigger, GenericInputBinding::R2),
BUTTON("ShootOffscreen", TRANSLATE_NOOP("Justifier", "Shoot Offscreen"), nullptr, Justifier::Binding::ShootOffscreen, GenericInputBinding::L2), BUTTON("ShootOffscreen", TRANSLATE_NOOP("Justifier", "Shoot Offscreen"), nullptr, Justifier::Binding::ShootOffscreen, GenericInputBinding::L2),
BUTTON("Start", TRANSLATE_NOOP("Justifier", "Start"), ICON_PF_START, Justifier::Binding::Start, GenericInputBinding::Cross), BUTTON("Start", TRANSLATE_NOOP("Justifier", "Start"), ICON_PF_START, Justifier::Binding::Start, GenericInputBinding::Cross),

View file

@ -478,8 +478,7 @@ void ControllerBindingWidget::bindBindingWidgets(QWidget* parent)
for (const Controller::ControllerBindingInfo& bi : m_controller_info->bindings) for (const Controller::ControllerBindingInfo& bi : m_controller_info->bindings)
{ {
if (bi.type == InputBindingInfo::Type::Axis || bi.type == InputBindingInfo::Type::HalfAxis || if (bi.type == InputBindingInfo::Type::Axis || bi.type == InputBindingInfo::Type::HalfAxis ||
bi.type == InputBindingInfo::Type::Button || bi.type == InputBindingInfo::Type::Pointer || bi.type == InputBindingInfo::Type::Button || bi.type == InputBindingInfo::Type::Pointer)
bi.type == InputBindingInfo::Type::AbsolutePointer)
{ {
InputBindingWidget* widget = parent->findChild<InputBindingWidget*>(QString::fromUtf8(bi.name)); InputBindingWidget* widget = parent->findChild<InputBindingWidget*>(QString::fromUtf8(bi.name));
if (!widget) if (!widget)

View file

@ -269,7 +269,7 @@ void InputBindingDialog::saveListToSettings()
else else
Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str()); Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str());
Host::CommitBaseSettingChanges(); Host::CommitBaseSettingChanges();
if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) if (m_bind_type == InputBindingInfo::Type::Pointer)
g_emu_thread->updateControllerSettings(); g_emu_thread->updateControllerSettings();
g_emu_thread->reloadInputBindings(); g_emu_thread->reloadInputBindings();
} }

View file

@ -227,7 +227,7 @@ void InputBindingWidget::setNewBinding()
{ {
Host::SetBaseStringSettingValue(m_section_name.c_str(), m_key_name.c_str(), new_binding.c_str()); Host::SetBaseStringSettingValue(m_section_name.c_str(), m_key_name.c_str(), new_binding.c_str());
Host::CommitBaseSettingChanges(); Host::CommitBaseSettingChanges();
if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) if (m_bind_type == InputBindingInfo::Type::Pointer)
g_emu_thread->updateControllerSettings(); g_emu_thread->updateControllerSettings();
g_emu_thread->reloadInputBindings(); g_emu_thread->reloadInputBindings();
} }
@ -250,7 +250,7 @@ void InputBindingWidget::clearBinding()
{ {
Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str()); Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str());
Host::CommitBaseSettingChanges(); Host::CommitBaseSettingChanges();
if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) if (m_bind_type == InputBindingInfo::Type::Pointer)
g_emu_thread->updateControllerSettings(); g_emu_thread->updateControllerSettings();
g_emu_thread->reloadInputBindings(); g_emu_thread->reloadInputBindings();
} }

View file

@ -302,7 +302,7 @@ bool InputManager::ParseBindingAndGetSource(std::string_view binding, InputBindi
std::string InputManager::ConvertInputBindingKeyToString(InputBindingInfo::Type binding_type, InputBindingKey key) std::string InputManager::ConvertInputBindingKeyToString(InputBindingInfo::Type binding_type, InputBindingKey key)
{ {
if (binding_type == InputBindingInfo::Type::Pointer || binding_type == InputBindingInfo::Type::AbsolutePointer) if (binding_type == InputBindingInfo::Type::Pointer)
{ {
// pointer and device bindings don't have a data part // pointer and device bindings don't have a data part
if (key.source_type == InputSourceType::Pointer) if (key.source_type == InputSourceType::Pointer)
@ -355,7 +355,7 @@ std::string InputManager::ConvertInputBindingKeysToString(InputBindingInfo::Type
const InputBindingKey* keys, size_t num_keys) const InputBindingKey* keys, size_t num_keys)
{ {
// can't have a chord of devices/pointers // can't have a chord of devices/pointers
if (binding_type == InputBindingInfo::Type::Pointer || binding_type == InputBindingInfo::Type::AbsolutePointer) if (binding_type == InputBindingInfo::Type::Pointer)
{ {
// so only take the first // so only take the first
if (num_keys > 0) if (num_keys > 0)
@ -853,7 +853,6 @@ void InputManager::AddPadBindings(SettingsInterface& si, const std::string& sect
break; break;
case InputBindingInfo::Type::Pointer: case InputBindingInfo::Type::Pointer:
case InputBindingInfo::Type::AbsolutePointer:
{ {
auto cb = [pad_index, base = bi.bind_index](InputBindingKey key, float value) { auto cb = [pad_index, base = bi.bind_index](InputBindingKey key, float value) {
if (!System::IsValid()) if (!System::IsValid())