# This Python file uses the following encoding: utf-8
import os
from pathlib import Path
import sys

from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QGraphicsScene

class CustomScene(QGraphicsScene):
    def __init__(self):
        super(CustomScene, self).__init__()

    def keyPressEvent(self, event):
        if event.key() == Qt.Key_Delete:
            print("delete")
            print(self.selectedItems())
            for item in self.selectedItems():
                self.removeItem(item)
            self.update()
        else:
            super(CustomScene, self).keyPressEvent(event)
