diff options
Diffstat (limited to 'src/samplesorter.cc')
-rw-r--r-- | src/samplesorter.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/samplesorter.cc b/src/samplesorter.cc index 91bc6b4..29c24e6 100644 --- a/src/samplesorter.cc +++ b/src/samplesorter.cc @@ -28,6 +28,7 @@ #include <QPainter> #include <QPaintEvent> +#include <QKeyEvent> #include <stdio.h> @@ -42,7 +43,7 @@ SampleSorter::SampleSorter(Selections& s, Selections& p, Instrument& instrument) , instrument(instrument) { setMouseTracking(true); - + setFocusPolicy(Qt::ClickFocus); // Enable keyboard event on click data = NULL; size = 0; attlen = 666; // Magical constants needs biblical proportions... @@ -329,3 +330,11 @@ void SampleSorter::mouseReleaseEvent(QMouseEvent* event) } } } + +void SampleSorter::keyReleaseEvent(QKeyEvent* event) +{ + if(selections.active() != SEL_NONE && event->key() == Qt::Key_Delete) + { + selections.remove(selections.active()); + } +} |