orhun / daktilo

Turn your keyboard into a typewriter! 📇
https://daktilo.cli.rs/
Apache License 2.0
1.05k stars 19 forks source link

Improve the carriage return #22

Open orhun opened 1 year ago

orhun commented 1 year ago

Is your feature request related to a problem? Please describe.

There were a few comments about the sound of the carriage return of the default preset.

I did kind of expect the carriage return to have some sort of ratchet sound that is dependent on the length of the line typed before the Enter key is pressed. :-)

As an old fart who actually used a typewriter, I must point out that the bell does not ring when you press the carriage return. The bell rings when you are nearing the end of the line to warn you that you are bout to run out of paper.

On carriage return, the sound should be a slow swing of the heavy carriage physically returning.

Describe the solution you'd like

n/a. Ideas welcome.

Describe alternatives you've considered

The carriage return sound is a long SFX so ding is maybe fine (?)

Additional context

See the comments on https://news.ycombinator.com/item?id=37751311

orhun commented 1 year ago

Some more suggestions:

Fast typing should give you a rapid-fire cluster of sounds (daktilo should be able to overlay the the next keystroke sound(s) before the current keystroke sound(s) has/have finished). Right now, the extra keystroke sounds are just skipped.

Shift key should not make a keystroke sound on press or release; it used to adjust the position of the keystroke assembly--so a dull clunk as the entire apparatus moves to a new position; CTRL and Alt (did not exist) should probably behave as Shift.

Backspace should make a different sound since it only moves the carriage. Delete (did not exist) should probably behave as Backspace.

The margin bell should ding after a (default, but configurable) 70 characters of typing, not when enter is pressed.

As another poster mentioned, when Return or Enter is pressed, the sound should be different--it should be the carriage returning; and ideally dependent on how many characters you've typed since the last Enter or Return.

I typed this whole message with daktilo on and my wife just came down the hall to ask "what's that sound"? :D

See: https://www.reddit.com/r/rust/comments/16xu33m/comment/k3fl32d/?utm_source=share&utm_medium=web2x&context=3

marcblum-ac commented 1 year ago

Maybe add to the list, that BLANK SPACE too should have a different sound, as it only moves the carriage.

And (in my memory) BACKSPACE made a different sound than BLANK SPACE, as BACK had to work against some spring, whereas the BLANK was supported by the spring. Hey, it was a full mechanical machine.

orhun commented 1 year ago

Another comment:

as someone who had used (manual) typewriters many years ago, I found one behavior not accurate. in the showcasing video, one can hear a bell rings every time you hit the carriage return key. but on a typewriter, it rings when the carriage moves to the rightmost point and thus it reminds you to return the carriage. so in my opinion, a more accurate behavior is, it rings when the cursor exceeds a certain column number, and it emits the sound of moving the carriage when you make a new line.

https://www.reddit.com/r/rust/comments/17b2phv/comment/k5hkwvt/?utm_source=share&utm_medium=web2x&context=3

flowchartsman commented 1 year ago

I wrote exactly this software recently in Go (still WIP and primitive), and was playing with the ding feature.

You can sort of calculate columns by counting runs of printable characters after enter is struck (decrementing for backspace), but the use of any arrow keys should turn off the feature until enter is struck again. Otherwise, you are going to be firing off random bells all over the place. It should probably also ignore keys with non-shift modifiers, since these are likely not typed, but that is somewhat complex, since sometimes, like with MacOS and alt, sometimes they ARE actual keystrokes.

At the end of the day, you kind of have to settle for "good enough" and err on the side of disabling it when in doubt, which is probably fine since the use case is niche and only really meaningful when typing long strings of prose anyway.

Here's the feature on a branch if you want to play around with how it sounds. clacksby is nowhere near as polished as daktilo, but it is more responsive, and you can hear what the keydown/keyup split sounds like along with the bell. You can also see some of the code I use to try and address the "machine gun" effect that comes from holding down a key. Still very early though.

edit: GH added a weird delay to the video, so here it is on YT: https://www.youtube.com/watch?v=dwkvoNdF3ps

Xenira commented 1 year ago

https://github.com/orhun/daktilo/assets/1288524/a1e59e1c-4f3b-4606-b7f8-51890979052b

Its 2 am, and I wasn't able to type straight anymore, but here is a demo using the method described in #54.

Great for knowing when you reached your line length limit.

Well, its way too late. End got cut off, but you can do stuff like disable dings in visual mode etc.

orhun commented 1 year ago

I wrote exactly this software recently in Go (still WIP and primitive),

That's pretty cool! Thank you for sharing your insight.

Its 2 am, and I wasn't able to type straight anymore, but here is a demo

We should probably take some approach to incorporate this feature in daktilo soon! (which brings me to #54)