Shift+Del to delete item in clipboard history

This commit is contained in:
André Zanghelini
2025-10-14 01:43:33 -03:00
parent 450a1493fe
commit c5bd1d6bc0
2 changed files with 8 additions and 2 deletions
@@ -96,7 +96,13 @@ RippleButton {
root.itemExecute() root.itemExecute()
} }
Keys.onPressed: (event) => { Keys.onPressed: (event) => {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { if (event.key === Qt.Key_Delete && event.modifiers === Qt.ShiftModifier) {
const deleteAction = root.entry.actions.find(action => action.name == "Delete");
if (deleteAction) {
deleteAction.execute()
}
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
root.keyboardDown = true root.keyboardDown = true
root.clicked() root.clicked()
event.accepted = true; event.accepted = true;
@@ -179,7 +179,7 @@ Item { // Wrapper
} }
// Only handle visible printable characters (ignore control chars, arrows, etc.) // Only handle visible printable characters (ignore control chars, arrows, etc.)
if (event.text && event.text.length === 1 && event.key !== Qt.Key_Enter && event.key !== Qt.Key_Return && event.text.charCodeAt(0) >= 0x20) // ignore control chars like Backspace, Tab, etc. if (event.text && event.text.length === 1 && event.key !== Qt.Key_Enter && event.key !== Qt.Key_Return && event.key !== Qt.Key_Delete && event.text.charCodeAt(0) >= 0x20) // ignore control chars like Backspace, Tab, etc.
{ {
if (!searchInput.activeFocus) { if (!searchInput.activeFocus) {
searchInput.forceActiveFocus(); searchInput.forceActiveFocus();