feat: Add a `beep` argument for Emojis
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
### Is your feature request related to a problem? Please describe.
The audible `beep` cue is a helpful signal to the user that an error has been made, but the nature of the error may not be obvious. The ability to distinguish one beep cue from another would be helpful to the user to better understand the mistake.
### Describe the solution you'd like
`beep` could be given an added argument for a string that would flash on the screen, then disappear. The expectation is that the text would be a single emoji character, but a developer may also decide to add a one or two-word message. For example:
` ... > context beep('🔔')`
The 🔔 would be inserted in the text output for a moment, then immediately deleted. This flashing icon would then be helpful to users who have muted audio and to the hearing impaired. Developers could then select an emoji that provided some context about the error made so that the user can then determine the corrective action needed.
An optional 2nd argument could then indicate a delay in milliseconds before the emoji is deleted:
```
... > context beep('☠️')
... > context beep('⬆️')
... > context beep('😲', 600)
... > context beep('💜', 350)
```
The ability to contextualize a `beep` cue can also help with debugging a keyboard, the input rule matched can then be more easily recognized. Note that the audible beep would still be emitted along with the text of the first argument.
`beep` can become a user signal that does not necessarily have to be about error messaging. `beep` could be used to communicate other info to the user such as the end of possible composition has been reached, or how many modifications remain. An example below, where an optional boolean argument has been introduced where when TRUE (or 1/0) would suppress the audio.
```
... > context(1) '...' beep('3️⃣ ',TRUE)
... > context(1) '...' beep('2️⃣', TRUE)
... > context(1) '...' beep('1️⃣', TRUE)
... > context(1) '...' beep('🛑', 500, TRUE) c or could be a celebratory '🎉'
```
### Describe alternatives you've considered
An audio tone argument for `beep` so it can emit different contextual sounds, but this seems harder to implement and for developers to specify.
### Related issues
_No response_
### Keyman apps
- [X] Keyman for Android
- [X] Keyman for iPhone and iPad
- [X] Keyman for Linux
- [X] Keyman for macOS
- [X] Keyman for Windows
- [X] Keyman Developer
- [X] KeymanWeb
- [ ] Other - give details at bottom of form
### Keyman version
17.0.328
### Operating system
Any
### Device
Any
### Target application
Any
### Browser
Any
### Keyboard name
Any
### Keyboard version
Any
### Language name
Any
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.