mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
UI: Fix hotkey settings screen not accepting all input on macOS
By default Qt will hand off key events to platform-native input methods on macOS because the OS or additional software can intercept key input and transform it (e.g. the international variations popping up when holding down the key for certain letters). This functionality can lead to certain key combinations being ignored because they don't call the delegate methods implemented by Qt to handle the input after it's been interpreted by the Input Method. Disabling Input Methods for hotkey input fields fixes this issue, as the native input methods are bypassed entirely and the key events are handled by the widget and its keyboard events directly.
This commit is contained in:
parent
1a7e5babc2
commit
c01d6bf4f7
|
@ -59,6 +59,15 @@ void OBSHotkeyEdit::keyPressEvent(QKeyEvent *event)
|
|||
HandleNewKey(new_key);
|
||||
}
|
||||
|
||||
QVariant OBSHotkeyEdit::inputMethodQuery(Qt::InputMethodQuery query) const
|
||||
{
|
||||
if (query == Qt::ImEnabled) {
|
||||
return false;
|
||||
} else {
|
||||
return QLineEdit::inputMethodQuery(query);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
void OBSHotkeyEdit::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
|
||||
void UpdateDuplicationState();
|
||||
bool hasDuplicate = false;
|
||||
QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
|
||||
|
||||
protected:
|
||||
OBSSignal layoutChanged;
|
||||
|
|
Loading…
Reference in a new issue