Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: ignore Qt::Key_unknown when parsing key sequences #14187

Merged
merged 1 commit into from Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions rpcs3/Input/keyboard_pad_handler.cpp
Expand Up @@ -317,7 +317,7 @@ void keyboard_pad_handler::processKeyEvent(QKeyEvent* event, bool pressed)
return;
}

auto handle_key = [this, pressed, event]()
const auto handle_key = [this, pressed, event]()
{
QStringList list = GetKeyNames(event);
if (list.isEmpty())
Expand All @@ -332,7 +332,7 @@ void keyboard_pad_handler::processKeyEvent(QKeyEvent* event, bool pressed)
// TODO: Edge case: switching numlock keeps numpad keys pressed due to now different modifier

// Handle every possible key combination, for example: ctrl+A -> {ctrl, A, ctrl+A}
for (const auto& keyname : list)
for (const QString& keyname : list)
{
// skip the 'original keys' when handling numpad keys
if (is_num_key && !keyname.contains("Num"))
Expand Down Expand Up @@ -807,7 +807,7 @@ u32 keyboard_pad_handler::GetKeyCode(const QString& keyName)
const QKeySequence seq(keyName);
u32 key_code = Qt::NoButton;

if (seq.count() == 1)
if (seq.count() == 1 && seq[0] != Qt::Key_unknown)
key_code = seq[0];
else
input_log.notice("GetKeyCode(%s): seq.count() = %d", keyName, seq.count());
Expand Down Expand Up @@ -907,7 +907,7 @@ bool keyboard_pad_handler::bindPadToDevice(std::shared_ptr<Pad> pad, u8 player_i

u32 pclass_profile = 0x0;

for (const auto& product : input::get_products_by_class(cfg->device_class_type))
for (const input::product_info& product : input::get_products_by_class(cfg->device_class_type))
{
if (product.vendor_id == cfg->vendor_id && product.product_id == cfg->product_id)
{
Expand Down