Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add TypeVariable Command for Variable Typing Speed #580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prithvijj
Copy link

@prithvijj prithvijj commented Feb 5, 2025

Changes

  • Adding in the TypeVariable command which types out the given letters in the string, in a variable typing speed,
  • The typing speed is determined by setting the TypingSpeedVariable option, 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

image

prits.gif showing the second echo command, has multiple pauses after each keystroke, feeling less robotic

prits

Other Notes

  • Related to Add a way to have variable typing speed #574

  • I considered using another TypeVariable command instead of integrating it within Type itself. I guess it's easier to keep things separate, instead of multiple options affecting the same Type command,

  • 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 @1s for 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?

- Adding in the `TypeVariable` command which types out the given
  letters in the string, in a variable typing speed,
- The typing speed is determined by setting the `TypingSpeedVariable`
  option, 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,
@prithvijj prithvijj marked this pull request as ready for review February 5, 2025 13:43
@prithvijj prithvijj requested a review from a team as a code owner February 5, 2025 13:43
@prithvijj prithvijj requested review from raphamorim and removed request for a team February 5, 2025 13:43
@meowgorithm
Copy link
Member

Hey @prithvijj! Just a note that per #583 (comment) we're going to hold off on this until we've given the feature the green light. Given our internal bandwidth we're aiming to be thoughtful about introducing new features given our internal capacity.

Also, one question is the idea here that the two numbers in a directive like Set TypingSpeedVariable 50ms 555ms are the high and low values?

@prithvijj
Copy link
Author

Hey @prithvijj! Just a note that per #583 (comment) we're going to hold off on this until we've given the feature the green light. Given our internal bandwidth we're aiming to be thoughtful about introducing new features given our internal capacity.

Yepp all good!

Also, one question is the idea here that the two numbers in a directive like Set TypingSpeedVariable 50ms 555ms are the high and low values?

Correct! just providing a range of min and max typing speed such that we wait after each keystroke for a given randomized number within the range, i.e. type e, wait 100ms, type c, wait 554ms, type h, wait 55ms etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants