Question: Can someone try and translate this into Javascript? i have been working on it for a while and i cant find out whats the correct

Can someone try and translate this into Javascript? i have been working on it for a while and i cant find out whats the correct way.
if textFill == '' or textFill == ' ':
posy = 0.1
keys = event.getKeys()
if 'escape' in keys:
core.quit() # So you can quit
else:
if keys:
if keys[0] == 'space':
posy = -0.01
textFill = textFill + ' '# Adds a space instead of 'space'
elif keys[0] == 'backspace':
textFill = textFill[:-1] # Deletes
elif keys[0] == 'return':
continueRoutine = False
else:
textFill += keys[0]
copyText.setText(textFill)
print(textFill)# Set new text on screen
else:
keys = event.getKeys()
if 'escape' in keys:
core.quit() # So you can quit
else:
if keys:
if keys[0] == 'space':
posy = -0.01
textFill = textFill + ' '# Adds a space instead of 'space'
elif keys[0] == 'backspace':
textFill = textFill[:-1] # Deletes
elif keys[0] == 'return':
continueRoutine = False
else:
textFill += keys[0]
copyText.setText(textFill)
print(textFill)# Set new text on screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!