Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started