Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+16 votes

when I try to delete the figure, the "delete" key seems not to work. I change the key to some other non-functional key, like "A", then the code works perfectly well. Please explain the issue and share me the way to fix.

asked in CSC 305 Fall 2024 by (165 points)

1 Answer

+4 votes

I think for that situation, you can try changing "KeyCode.DELETE" to "KeyCode.BACK_SPACE" .

answered by (1.1k points)
+4

Yes, sorry about that!

When I conceived that problem, I had forgotten that Mac computers have a key that is labeled "Delete" on the keyboard, but it is actually mapped to the BACK_SPACE key in programming languages, due to it's having backspace functionality (deleting the thing behind the cursor), as opposed to the delete key on Windows, which deletes the thing in front of the cursor.

...