(if "backspace" in keys) Not Working

OS (OS Monterey 12.4):
PsychoPy version (2023.2.1)
Standalone (y)
**My old code for picking up on the ‘backspace’ key and using it to remove the last character from a string doesn’t work anymore. The code is in python and pushed to Pavlovia through the automatic javascript translation. This has always worked, I believe it might be an issue with the new version. Here is a snippet of the code with the relevant part:

if len(keys):
if ‘space’ in keys:
engbox_txt44.text = engbox_txt44.text + ’ ’
elif ‘backspace’ in keys:
engbox_txt44.text = engbox_txt44.text[:-1]

When I changed the ‘backspace’ piece to ‘space’ or any other key the code worked fine and the last character was deleted. The issue I imagine is with the code not recognizing the ‘backspace’ key.

No character is actually removed from the string.