Prevent alt+letter from writting text in fields

This commit is contained in:
miruka 2019-08-22 14:23:33 -04:00
parent a47351a5ad
commit 2ff65af6ab
3 changed files with 11 additions and 7 deletions

View File

@ -27,6 +27,11 @@ ScrollView {
color: theme.controls.textArea.background
}
Keys.onPressed: if (
event.modifiers & Qt.AltModifier ||
event.modifiers & Qt.MetaModifier
) event.accepted = true
Keys.forwardTo: mainUI.shortcuts
}
}

View File

@ -28,5 +28,11 @@ TextField {
}
selectByMouse: true
Keys.onPressed: if (
event.modifiers & Qt.AltModifier ||
event.modifiers & Qt.MetaModifier
) event.accepted = true
Keys.forwardTo: mainUI.shortcuts
}

View File

@ -169,13 +169,6 @@ HRectangle {
})
area.Keys.onPressed.connect(event => {
if (event.modifiers == Qt.MetaModifier) {
// Prevent super+key from sending the key as text
// on xwayland
event.accepted = true
return
}
if (event.modifiers == Qt.NoModifier &&
event.key == Qt.Key_Backspace &&
! textArea.selectedText)