mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
27e6548343
Fixes #1488. `is_key_down` was only set to true when `insertText` was called. Therefore `is_key_down` was actually meant to store whether the most recently pressed key generated an `insertText` event, at which, winit produces a `ReceivedCharacter`. The issue is that `insertText` is *not* called for "key repeat", but winit wants to send `ReceivedCharacter` events for "key repeat" too. To solve this, the `is_key_down` variable was then checked in the `key_down` function to determine whether it was valid to produce repeated `ReceivedCharacter` events during "key repeat". However this check is not needed since `ReceivedCharacter` must always be called if the key event has a non-empty `characters` property. Furthermore `is_key_down` didn't actually store whether the previously pressed character had an `insertText` event, because it was incorrectly set to false on every "key up". This meant that if two keys were pressed consecutively and then the first was released, then `is_key_down` was set to false even if the most recent keypress did actually produce an `insertText`. Update changelog. |
||
---|---|---|
.. | ||
android | ||
ios | ||
linux | ||
macos | ||
web | ||
windows | ||
mod.rs |