code: def keyPressEvent(self, ev):
      key = ev.key()
      shapesBackup = copy.deepcopy(self.shapes)
      if len(shapesBackup) == 0:
          return
      self.shapesBackups.pop()
      self.shapesBackups.append(shapesBackup)
      if key == Qt.Key_Escape and self.current:
          print("ESC press")
          self.current = None
          self.drawingPolygon.emit(False)
          self.update()
      elif key == Qt.Key_Return and self.canCloseShape():
          self.finalise()
      elif key == Qt.Key_Left and self.selectedShapes:
          self.moveOnePixel("Left")
      elif key == Qt.Key_Right and self.selectedShapes:
          self.moveOnePixel("Right")
      elif key == Qt.Key_Up and self.selectedShapes:
          self.moveOnePixel("Up")
      elif key == Qt.Key_Down and self.selectedShapes:
          self.moveOnePixel("Down")
      elif key == Qt.Key_X and self.selectedShapes:
          for i in range(len(self.selectedShapes)):
              self.selectedShape = self.selectedShapes[i]
              if self.rotateOutOfBound(0.01):
                  continue
              self.selectedShape.rotate(0.01)
          self.shapeMoved.emit()
          self.update()
  
      elif key == Qt.Key_C and self.selectedShapes:
          for i in range(len(self.selectedShapes)):
              self.selectedShape = self.selectedShapes[i]
              if self.rotateOutOfBound(-0.01):
                  continue
              self.selectedShape.rotate(-0.01)
          self.shapeMoved.emit()
          self.update()
  
imports: import copy
  from PyQt5.QtCore import Qt, pyqtSignal, QPointF, QPoint
  from PyQt5.QtGui import QPainter, QBrush, QColor, QPixmap
  from PyQt5.QtWidgets import QWidget, QMenu, QApplication
  from libs.shape import Shape
  from libs.utils import distance
label_desc: Use image node_id 42 for calling the Canvas obj's underlying member method code with example usage: obj.keyPressEvent(ev) without return types