feat: Add `TypeVariable` Command for Variable Typing Speed
Changes
- Adding in the
TypeVariablecommand which types out the given letters in the string, in a variable typing speed, - The typing speed is determined by setting the
TypingSpeedVariableoption, and providing a min and max typing speed range - After every keystroke, it would wait randomly within the min and max typing speed range, such that it feels more human,
Testing Notes
Created prits.tape
Output prits.gif
Require echo
Set Shell "bash"
Set FontSize 32
Set Width 1200
Set Height 600
Set TypingSpeedVariable 50ms 555ms
Type "echo 'Welcome to VHS!'" Sleep 500ms Enter
TypeVariable "echo 'Welcome to VHS!'" Sleep 500ms Enter
Ran go run . prits.tape which produced prits.gif
prits.gif showing the second echo command, has multiple pauses after each keystroke, feeling less robotic
Other Notes
-
Related to https://github.com/charmbracelet/vhs/issues/574
-
I considered using another
TypeVariablecommand instead of integrating it withinTypeitself. I guess it's easier to keep things separate, instead of multiple options affecting the sameTypecommand, -
[ ] Not sure how the
TypeVariable@would work, would be good to get some direction. Does[email protected] 2s "blah blah"be okay -
[ ] I think I'm doing something wrong around
parseTypeVariable, in the sense of not parsing the@1sfor indicating speed (i.e. overrides of the speed), Would be cool to get some help/direction on that -
[ ] Is there anything else I'm missing?