winit-sonoma-fix/src/platform_impl
jim jammer 27e6548343
macOS: Remove is_key_down from ViewState (#1489)
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.
2021-07-13 17:38:01 +02:00
..
android Implement Window::request_redraw on Android (#1953) 2021-06-05 12:47:08 +02:00
ios Implemented focus_window (#1944) 2021-05-19 18:39:53 +02:00
linux On X11 and Wayland, add is_maximized support 2021-06-10 10:43:27 +03:00
macos macOS: Remove is_key_down from ViewState (#1489) 2021-07-13 17:38:01 +02:00
web Remove support for stdweb (#1941) 2021-05-24 10:06:21 -07:00
windows Document how main_thread_id for Windows works (#1951) 2021-06-05 12:46:44 +02:00
mod.rs Merge branch 'master' into merge-master-to-web 2019-09-24 14:21:18 -04:00