Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions

Question

=+define what a real-time operating system is.?

Answered: 1 week ago