Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codecast functionality like cssdeck [closed]

Recently codemirror project caught my attention. Jsbin uses codemirror behind the scenes.

After spending some time on that website, I found cssdeck. Inside cssdeck they are implementing a feature known as codecasts.

Codecasts lets us record our typing and later we can playback that recorded code. Most interestingly the code is still editable when we are playing a recorded implementation.

Check out this example.

Does anyone have any idea on how to create such functionality?

like image 254
Naresh Devineni Avatar asked Jun 21 '26 06:06

Naresh Devineni


1 Answers

Isn't this just recording keypresses and then playing them back?

Presumably each event is an object that records which window the keypress it was in, the time (e.g. elapsed milliseconds since the previous event) and the key pressed (including backspace).

There may also need to be special entries to cope with mouse clicks changing the cursor position.

So you can simply build up an array of these keypress objects and then play them back from the start.

like image 173
Matthew Strawbridge Avatar answered Jun 22 '26 21:06

Matthew Strawbridge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!