Ensure that winforms doesn't beep when confirming content. #2374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reported via @ethindp on Discord.
Pressing enter in a TextInput under Winforms generates a system beep. This is the default behaviour for an Enter keypress in a TextInput; however, in Toga's case, it's undesirable.
This PR marks the event as processed when Enter is pressed, so that the event doesn't propagate any further, preventing the beep.
I can't think of any reliable way to test this, as we can't monitor for the existence of a system beep, and we don't have visibility on the processing of system events.
It wasn't detected previously (at least, in my case) because the VM I use to test Windows didn't have a speaker connected, so I didn't hear system beeps.
PR Checklist: