Prevent alt+letter from writting text in fields
This commit is contained in:
parent
a47351a5ad
commit
2ff65af6ab
|
@ -27,6 +27,11 @@ ScrollView {
|
||||||
color: theme.controls.textArea.background
|
color: theme.controls.textArea.background
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keys.onPressed: if (
|
||||||
|
event.modifiers & Qt.AltModifier ||
|
||||||
|
event.modifiers & Qt.MetaModifier
|
||||||
|
) event.accepted = true
|
||||||
|
|
||||||
Keys.forwardTo: mainUI.shortcuts
|
Keys.forwardTo: mainUI.shortcuts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,5 +28,11 @@ TextField {
|
||||||
}
|
}
|
||||||
|
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
|
||||||
|
Keys.onPressed: if (
|
||||||
|
event.modifiers & Qt.AltModifier ||
|
||||||
|
event.modifiers & Qt.MetaModifier
|
||||||
|
) event.accepted = true
|
||||||
|
|
||||||
Keys.forwardTo: mainUI.shortcuts
|
Keys.forwardTo: mainUI.shortcuts
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,13 +169,6 @@ HRectangle {
|
||||||
})
|
})
|
||||||
|
|
||||||
area.Keys.onPressed.connect(event => {
|
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 &&
|
if (event.modifiers == Qt.NoModifier &&
|
||||||
event.key == Qt.Key_Backspace &&
|
event.key == Qt.Key_Backspace &&
|
||||||
! textArea.selectedText)
|
! textArea.selectedText)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user