Crazy-Marvin / Morse

Translator for converting text into morse code and vice-versa
https://crazymarvin.com/morse/
Apache License 2.0
142 stars 30 forks source link

Space (represented with slash) functions as an indefinite dash on screen flash mode #179

Open huang7311 opened 5 months ago

huang7311 commented 5 months ago

Description

When the output reaches a space (represented in the program as a slash) it makes the screen become white indefinitely. You can only solve it by manually closing the program and opening it again, but then your message is lost and you have to recreate one without spaces.

Steps to reproduce

  1. Type any message that contains a space (such as "a a"; or even something as simple as a single space " ")
  2. Click the screen flash button
  3. Observe that the screen is white indefinitely.

Expected behavior

According to Wikipedia and the various other Issues raised, there is a mandatory gap between dots and dashes as follows:

  1. The length of signal absence (gap) between dots/dashes is the length of a dot. (In the code, I think this should be structured as a separate variable not linked to the length of the dot's flash)
  2. The gap between letters is equal to a dash (meaning 3 dots). (Once again, this variable should probably not be scaled based on the previous item's variable)
  3. The gap between words (AKA a space) is equal to 7 dots.

Therefore, the space (represented as "/" in the program) must be a mandatory pause that does not activate the screen and should have the same time as seven dots.

Ideally, the user should be able to control the length of signal absence between ditdah, letter, and word.

Tech info

Device: Any Android device or emulator

Additional context

I think it would also be nice if we could change the color that gets projected through the screen using a color picker, so I could set it to red RGB (255,0,0) and it wouldn't be so hard on the eyes. I had to use the screen flash mode because the flashlight mode is buggy and doesn't have a gap between dots and dashes, causing every letter and every word to be one long dash.

CrazyMarvin commented 5 months ago

Thanks for the report, @huang7311! πŸ‘ Are you able to create a PR?

huang7311 commented 5 months ago

Thanks for the report, @huang7311! πŸ‘ Are you able to create a PR?

I'll do what I can to fix this issue. I'll start by adding mandatory pause between dot/dash, letter, space, etc. Later I will see if I can add options to change the length of pause in settings.

Also: I was thinking of making it so the app could use different morse standards that the user could toggle between, and perhaps some that a user created themself. (See https://upload.wikimedia.org/wikipedia/en/thumb/5/5a/Morse_comparison.svg/800px-Morse_comparison.svg.png ) This would need a restructuring towards a config file approach, with each file being a standard. I will look into this later.

CrazyMarvin commented 5 months ago

Thanks for the report, @huang7311! πŸ‘ Are you able to create a PR?

I'll do what I can to fix this issue. I'll start by adding mandatory pause between dot/dash, letter, space, etc. Later I will see if I can add options to change the length of pause in settings.

Also: I was thinking of making it so the app could use different morse standards that the user could toggle between, and perhaps some that a user created themself. (See https://upload.wikimedia.org/wikipedia/en/thumb/5/5a/Morse_comparison.svg/800px-Morse_comparison.svg.png ) This would need a restructuring towards a config file approach, with each file being a standard. I will look into this later.

Wow, that sounds awesome! πŸ‘