mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
keyboard: only map single buttons
key combos are not really supported at the moment
This commit is contained in:
parent
7bcaab4f3a
commit
4d5897d519
@ -418,7 +418,7 @@ void keyboard_pad_handler::processKeyEvent(QKeyEvent* event, bool pressed)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const bool is_num_key = list.removeAll("Num") > 0;
|
const bool is_num_key = list.removeAll("Num") > 0;
|
||||||
const QString name = QString::fromStdString(GetKeyName(event));
|
const QString name = QString::fromStdString(GetKeyName(event, true));
|
||||||
|
|
||||||
// TODO: Edge case: switching numlock keeps numpad keys pressed due to now different modifier
|
// TODO: Edge case: switching numlock keeps numpad keys pressed due to now different modifier
|
||||||
|
|
||||||
@ -824,7 +824,7 @@ QStringList keyboard_pad_handler::GetKeyNames(const QKeyEvent* keyEvent)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string keyboard_pad_handler::GetKeyName(const QKeyEvent* keyEvent)
|
std::string keyboard_pad_handler::GetKeyName(const QKeyEvent* keyEvent, bool with_modifiers)
|
||||||
{
|
{
|
||||||
// Handle special cases first
|
// Handle special cases first
|
||||||
if (std::string name = native_scan_code_to_string(keyEvent->nativeScanCode()); !name.empty())
|
if (std::string name = native_scan_code_to_string(keyEvent->nativeScanCode()); !name.empty())
|
||||||
@ -852,7 +852,13 @@ std::string keyboard_pad_handler::GetKeyName(const QKeyEvent* keyEvent)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return QKeySequence(keyEvent->key() | keyEvent->modifiers()).toString(QKeySequence::NativeText).toStdString();
|
|
||||||
|
if (with_modifiers)
|
||||||
|
{
|
||||||
|
return QKeySequence(keyEvent->key() | keyEvent->modifiers()).toString(QKeySequence::NativeText).toStdString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QKeySequence(keyEvent->key()).toString(QKeySequence::NativeText).toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string keyboard_pad_handler::GetKeyName(const u32& keyCode)
|
std::string keyboard_pad_handler::GetKeyName(const u32& keyCode)
|
||||||
|
@ -91,7 +91,7 @@ public:
|
|||||||
static std::string GetMouseName(const QMouseEvent* event);
|
static std::string GetMouseName(const QMouseEvent* event);
|
||||||
static std::string GetMouseName(u32 button);
|
static std::string GetMouseName(u32 button);
|
||||||
static QStringList GetKeyNames(const QKeyEvent* keyEvent);
|
static QStringList GetKeyNames(const QKeyEvent* keyEvent);
|
||||||
static std::string GetKeyName(const QKeyEvent* keyEvent);
|
static std::string GetKeyName(const QKeyEvent* keyEvent, bool with_modifiers);
|
||||||
static std::string GetKeyName(const u32& keyCode);
|
static std::string GetKeyName(const u32& keyCode);
|
||||||
static std::set<u32> GetKeyCodes(const cfg::string& cfg_string);
|
static std::set<u32> GetKeyCodes(const cfg::string& cfg_string);
|
||||||
static u32 GetKeyCode(const QString& keyName);
|
static u32 GetKeyCode(const QString& keyName);
|
||||||
|
@ -883,7 +883,7 @@ void pad_settings_dialog::keyPressEvent(QKeyEvent *keyEvent)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_cfg_entries[m_button_id].insert_key(keyboard_pad_handler::GetKeyName(keyEvent), m_enable_multi_binding);
|
m_cfg_entries[m_button_id].insert_key(keyboard_pad_handler::GetKeyName(keyEvent, false), m_enable_multi_binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReactivateButtons();
|
ReactivateButtons();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user