From a81f78045b209420cbc243af27890bd196cc2697 Mon Sep 17 00:00:00 2001
From: Enrico Turri <enricoturri@seznam.cz>
Date: Tue, 10 Apr 2018 12:47:09 +0200
Subject: [PATCH] Delete key enabled in Object's Settings Dialog also for 3D
 view

---
 lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
index 47fd8a092..f7e38ed87 100644
--- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
+++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
@@ -9,7 +9,7 @@ use utf8;
 use File::Basename qw(basename);
 use Wx qw(:misc :sizer :treectrl :button :keycode wxTAB_TRAVERSAL wxSUNKEN_BORDER wxBITMAP_TYPE_PNG wxID_CANCEL wxMOD_CONTROL
     wxTheApp);
-use Wx::Event qw(EVT_BUTTON EVT_TREE_ITEM_COLLAPSING EVT_TREE_SEL_CHANGED EVT_TREE_KEY_DOWN);
+use Wx::Event qw(EVT_BUTTON EVT_TREE_ITEM_COLLAPSING EVT_TREE_SEL_CHANGED EVT_TREE_KEY_DOWN EVT_KEY_DOWN);
 use base 'Wx::Panel';
 
 use constant ICON_OBJECT        => 0;
@@ -191,6 +191,14 @@ sub new {
     EVT_BUTTON($self, $self->{btn_split}, \&on_btn_split);
     EVT_BUTTON($self, $self->{btn_move_up}, \&on_btn_move_up);
     EVT_BUTTON($self, $self->{btn_move_down}, \&on_btn_move_down);
+    EVT_KEY_DOWN($canvas, sub {
+        my ($canvas, $event) = @_;
+        if ($event->GetKeyCode == WXK_DELETE) {
+            $canvas->GetParent->on_btn_delete;
+        } else {
+            $event->Skip;
+        }
+    });
     
     $self->reload_tree;