JavaScript Emscripten: replacing prompt with console (of some sort)

I have (interactive - like python shell) C++ console application and went playing with Emscripten (to transcompile from C++ to JS). All is well, but I'd like the JS's focus-stealing prompt to be replaced with something less... eccentric.

What I've tried: I added an input textarea and a button to generated html, and replaced the prompt-invoking line with a while loop (looping until user the button is pressed). This didn't work very well, the empty loop froze the browser (which is probably expected, but there is no sleep function in JS).

So, in short, what I want is this layout:

output textarea / output textarea / output textarea / output textarea
output textarea / output textarea / output textarea / output textarea
output textarea / output textarea / output textarea / output textarea
output textarea / output textarea / output textarea / output textarea

input textarea <ok button>

and behaviour:

while (1)
  let program work until input requested
  wait for user to clik on the <ok button> above

Any simple way to achieve this by modifying the (emcc's) generated JS code? (I have an idea how to achieve this by modifying (my) original code, but would like to avoid that if possible)

Answer:1

I'm breaking my head for few days trying to solve this and can't seems to find answer. I'm trying to build a proof of concept for video player using HTML5 that works on Android and IOS, the trick is ...

I'm breaking my head for few days trying to solve this and can't seems to find answer. I'm trying to build a proof of concept for video player using HTML5 that works on Android and IOS, the trick is ...

  1. best way display snakeskin
  2. desmume best display method

I have an array that can look like this: ["whatWP", "isVBZ", "theDT", "temperatureNN", "inIN", "bostonNN"] I want to access the element containing IN, if it exists and the next elements(s) until I ...

I have an array that can look like this: ["whatWP", "isVBZ", "theDT", "temperatureNN", "inIN", "bostonNN"] I want to access the element containing IN, if it exists and the next elements(s) until I ...

  1. access elements array python
  2. access elements array javascript
  3. access elements array java
  4. access elements array bash
  5. access elements array swift
  6. access array elements using pointers
  7. access array elements using indexes
  8. access array elements in php
  9. access array elements using pointers in c
  10. access array elements matlab
  11. access array elements
  12. access array elements in perl
  13. access array elements in c
  14. access array elements scala
  15. access array elements in shell script
  16. access array elements in mongodb
  17. access array elements numpy
  18. access array elements js
  19. access array elements in angular
  20. access array elements using indexes in java

.sr-only the CSS class of the Bootstrap library is used to make things disappear on computer screens only. Is there any opposite class for it to make things disappear on mobiles only? I know there ...

.sr-only the CSS class of the Bootstrap library is used to make things disappear on computer screens only. Is there any opposite class for it to make things disappear on mobiles only? I know there ...

I want to make a simple audio only stream over WebRTC, using Peer.js. I'm running the simple PeerServer locally. The following works perfectly fine in Firefox 30, but I can't get it to work in Chrome ...

I want to make a simple audio only stream over WebRTC, using Peer.js. I'm running the simple PeerServer locally. The following works perfectly fine in Firefox 30, but I can't get it to work in Chrome ...

  1. chrome won't open
  2. chrome won't open on mac
  3. chrome won't play sound
  4. chrome won't update
  5. chrome wont open on pc
  6. chrome won't connect to internet
  7. chrome won't play videos
  8. chrome won't download
  9. chrome won't load pages
  10. chrome won't open pdf
  11. chrome won't open windows 10
  12. chrome won't uninstall
  13. chrome won't save passwords
  14. chrome won't download files
  15. chrome won't play audio
  16. chrome won't open on windows 7
  17. chrome won't print
  18. chrome won't sync
  19. chrome won't allow flash
  20. chrome won't open aw snap