It looks like cv2 only like detecting keycodes for letters/characters and numbers and returns 0 for anything that isn't one (ESC is an exception).
The delete key returns 0. You cannot use it.
Also, you're not going to be able to detect any key presses right now with your code, as cv2 requires a window open to detect key presses.