From a7d43efe1523292958a91fde1bf095fb635c6881 Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Fri, 16 Oct 2015 11:02:02 +0200 Subject: [PATCH] Binds the backspace button to deleteSelection functionality fixes #CURA-249 --- resources/qml/Actions.qml | 1 - resources/qml/Cura.qml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index e3ff6c9937..865c0b749b 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -137,7 +137,6 @@ Item id: deleteObjectAction; text: catalog.i18nc("@action:inmenu","Delete Object"); iconName: "edit-delete"; - shortcut: StandardKey.Backspace; } Action diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 93bc311da1..32ceef4cf1 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -22,6 +22,19 @@ UM.MainWindow id: backgroundItem; anchors.fill: parent; UM.I18nCatalog{id: catalog; name:"cura"} + + //DeleteSelection on the keypress backspace event + Keys.onPressed: { + if (event.key == Qt.Key_Backspace) + { + if(objectContextMenu.objectId != 0) + { + Printer.deleteObject(objectContextMenu.objectId); + } + } + } + + UM.ApplicationMenu { id: menu