My Profile Photo

Deviant Syndrome


coding, multimedia, gamedev, engineering


OverType TypeWriter Simulator

When Too Realistic is Not Enough

Have you folks seen this amazing JS demo, resembling an old typewriter? I, personally, find it hilarious and enjoyable. The ink refill process, the brokeness fader, the click sound, this makes it almost an ideal soft machine.

There is one problem though, which, sadly, cannot really attribute that to the precision of the simulation. Sometimes, it will just hangs up, stop reacting to any keystrokes, and there is no way to save the text you’ve already typed, or, continuing the analogy, - feed the page back into the roll, after you fix the jam.

My intuitive approach to this show-stopper, would be just re-run the bits of javascript that set the virtual typewriter up. I found a very useful code bit somewhere, which worked exactly as I expected.

var arr = document.head.getElementsByTagName('script')
for (var n = 0; n < arr.length; n++)
    eval(arr[n].innerHTML) //run script inside div

Thanks to this, I was able to finish a page of my upcoming horror-story fanzine. Hell yeah, you cannot really achieve it in any other way, than using a good old typewriter!