From bbfee03a6c51a4bf52eb0de06b9c587c638c937c Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Thu, 30 Nov 2023 16:09:09 -0800 Subject: [PATCH 1/4] Add migration guide for RawKeyEvent to KeyEvent --- src/release/breaking-changes/index.md | 2 + .../breaking-changes/key-event-migration.md | 287 ++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 src/release/breaking-changes/key-event-migration.md diff --git a/src/release/breaking-changes/index.md b/src/release/breaking-changes/index.md index cd13ae184c7..6e03b811808 100644 --- a/src/release/breaking-changes/index.md +++ b/src/release/breaking-changes/index.md @@ -39,6 +39,7 @@ release, and listed in alphabetical order: ### Released in Flutter 3.16 +* [Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system][] * [Migrate ShortcutActivator and ShortcutManager to KeyEvent system][] * [The `ThemeData.useMaterial3` property is now set to true by default][] * [Deprecated API removed after v3.13][] @@ -52,6 +53,7 @@ release, and listed in alphabetical order: * [Windows: External windows should notify Flutter engine of lifecycle changes][] * [Windows build path changed to add the target architecture][] +[Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system]: {{site.url}}/release/breaking-changes/key-event-migration [Migrate ShortcutActivator and ShortcutManager to KeyEvent system]: {{site.url}}/release/breaking-changes/shortcut-key-event-migration [The `ThemeData.useMaterial3` property is now set to true by default]: {{site.url}}/release/breaking-changes/material-3-default [Deprecated API removed after v3.13]: {{site.url}}/release/breaking-changes/3-13-deprecations diff --git a/src/release/breaking-changes/key-event-migration.md b/src/release/breaking-changes/key-event-migration.md new file mode 100644 index 00000000000..1db8795010e --- /dev/null +++ b/src/release/breaking-changes/key-event-migration.md @@ -0,0 +1,287 @@ +--- +title: Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system +description: > + The raw key event subsystem has been superseded by the key event subsystem, + and APIs that use RawKeyEvent and RawKeyboard are converted to KeyEvent and + HardwareKeyboard. +--- + +## Summary + +For some time now (years), Flutter has had two key event systems implemented. +The new system reached parity with the old platform-specific raw key event +system, and the raw system has been deprecated. + +## Context + +In the original key event subsystem handling each platform's quirks in the +framework and in client apps caused overly complex code, and the old system +didn't properly represent the true state of key events on the system. + +[RawKeyboard] is the legacy API, and has been deprecated and will be removed in +the future. The replacements are [HardwareKeyboard] and [KeyEvent] +APIs (such as [FocusNode.onKeyEvent]). + +Behavior-wise, [RawKeyboard] provided a less unified, less regular +event model than [HardwareKeyboard] does. For example: + +* Down events were not always matched with an up event, and vice versa (the + set of pressed keys was silently updated). +* The logical key of the down event was not always the same as that of the up + event. +* Down events and repeat events were not easily distinguishable (had to be + tracked manually). +* Lock modes (such as CapsLock) only had their "enabled" state recorded. + There was no way to acquire their pressed state. + +So, the new [`KeyEvent`][]/[`HardwareKeyboard`][]-based system was born and, to +minimize breaking changes, was implemented in parallel with the old system with +the intention of eventually deprecating the raw system. That time has arrived, +and application developers should migrate their code to avoid breaking changes +that will occur when the deprecated APIs are removed. + +## Description of change + +Summary of APIs that have been deprecated: + +* [`Focus.onKey`][] +* [`FocusNode.attach`][]'s `onKey` argument. +* [`FocusNode.onKey`][] +* [`FocusOnKeyCallback`][] +* [`FocusScope.onKey`][] +* [`FocusScopeNode.onKey`][] +* [`GLFWKeyHelper`][] +* [`GtkKeyHelper`][] +* [`KeyboardSide`][] +* [`KeyDataTransitMode`][] +* [`KeyEventManager`][] +* [`KeyHelper`][] +* [`KeyMessage`][] +* [`KeyMessageHandler`][] +* [`ModifierKey`][] +* [`RawKeyboard`][] +* [`RawKeyboardListener`][] +* [`RawKeyDownEvent`][] +* [`RawKeyEvent`][] +* [`RawKeyEventData`][] +* [`RawKeyEventDataAndroid`][] +* [`RawKeyEventDataFuchsia`][] +* [`RawKeyEventDataIos`][] +* [`RawKeyEventDataLinux`][] +* [`RawKeyEventDataMacOs`][] +* [`RawKeyEventDataWeb`][] +* [`RawKeyEventDataWindows`][] +* [`RawKeyEventHandler`][] +* [`RawKeyUpEvent`][] +* [`ServicesBinding.keyEventManager`][] +* [`KeySimulatorTransitModeVariant`][] +* [`debugKeyEventSimulatorTransitModeOverride`][] + +## Migration guide + +APIs provided by the Flutter framework are already migrated. Migration is needed +only if any of the classes or methods listed in the previous section are used. + +### Migrating your code that uses `RawKeyEvent` + +For the most part, there are equivalent `KeyEvent` APIs available for all of the +`RawKeyEvent` APIs. + +Some APIs relating to platform specific information contained in +[`RawKeyEventData`][] objects or their subclasses has been removed and is no +longer supported. One exception is that [`RawKeyEventDataAndroid.eventSource`][] +information is accessible now as [`KeyEvent.deviceType`][] in a more +platform independent form. + +#### Migrating `IsKeyPressed` and related functions + +If the legacy code used the [`RawKeyEvent.isKeyPressed`][], +[`RawKeyEvent.isControlPressed`][], [`RawKeyEvent.isShiftPressed`][], +[`RawKeyEvent.isAltPressed`][], or [`RawKeyEvent.isMetaPressed`][] APIs, there +are equivalent functions on the [`HardwareKeyboard`][] singleton instance. + +Before: + +```dart +KeyEventResult _handleKeyEvent(RawKeyEvent keyEvent) { + if (keyEvent.isControlPressed || + keyEvent.isShiftPressed || + keyEvent.isAltPressed || + keyEvent.isMetaPressed) { + print('Modifier pressed: $keyEvent'); + } + if (keyEvent.isKeyPressed(LogicalKeyboardKey.keyA)) { + print('Key A pressed.'); + } + return KeyEventResult.ignored; +} +``` + +After: + +```dart +KeyEventResult _handleKeyEvent(KeyEvent _) { + if (HardwareKeyboard.instance.isControlPressed || + HardwareKeyboard.instance.isShiftPressed || + HardwareKeyboard.instance.isAltPressed || + HardwareKeyboard.instance.isMetaPressed) { + print('Modifier pressed: $keyEvent'); + } + if (HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.keyA)) { + print('Key A pressed.'); + } + return KeyEventResult.ignored; +} +``` + +#### Setting `onKey` for focus + +If you were setting the `onKey` parameter of the `Focus`, `FocusScope`, +`FocusNode`, or `FocusScopeNode` classes, then there is an equivalent +`onKeyEvent` parameter that supplies `KeyEvent`s instead of `RawKeyEvent`. + +```dart +Widget build(BuildContext context) { + return Focus( + onKey: (RawKeyEvent keyEvent) { + print('Key event: $keyEvent'); + return KeyEventResult.ignored; + } + child: child, + ); +} +``` + +After: + +```dart +Widget build(BuildContext context) { + return Focus( + onKeyEvent: (KeyEvent keyEvent) { + print('Key event: $keyEvent'); + return KeyEventResult.ignored; + } + child: child, + ); +} +``` + +#### Repeat key event handling + +If you were relying on the [`RawKeyEvent.repeat`][] attribute to determine if a +key was a repeated key event, that has now been separated into a separate +[`KeyRepeatEvent`][] type. + +Before: + +```dart +KeyEventResult _handleKeyEvent(RawKeyEvent keyEvent) { + if (keyEvent is RawKeyDownEvent) { + print('Key down: ${keyEvent.data.logicalKey.keyLabel}(${keyEvent.repeat ? ' (repeated)' : ''})'); + } + return KeyEventResult.ignored; +} +``` + +After: + +```dart +KeyEventResult _handleKeyEvent(KeyEvent _) { + if (keyEvent is KeyDownEvent || keyEvent is KeyRepeatEvent) { + print('Key down: ${keyEvent.logicalKey.keyLabel}(${keyEvent is KeyRepeatEvent ? ' (repeated)' : ''})'); + } + return KeyEventResult.ignored; +} +``` + +Be careful to check conditionals: a `KeyRepeatEvent` is also a key down event, +but it is a different type (and it is not a subclass of `KeyDownEvent`), so +don't assume that `keyEvent is! KeyDownEvent` only allows key up events, because +both `KeyDownEvent` and `KeyRepeatEvent` need to be checked. + +## Timeline + +Landed in version: 3.17.0-18.0.pre
+In stable release: not yet (Not in 3.17) + +## References + +Replacement API documentation: + +* [`Focus.onKeyEvent`][] +* [`FocusNode.onKeyEvent`][] +* [`FocusOnKeyEventCallback`][] +* [`FocusScope.onKeyEvent`][] +* [`FocusScopeNode.onKeyEvent`][] +* [`HardwareKeyboard`][] +* [`KeyboardListener`][] +* [`KeyDownEvent`][] +* [`KeyRepeatEvent`][] +* [`KeyEvent`][] +* [`KeyEventHandler`][] +* [`KeyUpEvent`][] + +Relevant issues: + +* [`RawKeyEvent` and `RawKeyboard`, et al should be deprecated and removed (Issue 136419)][] + +Relevant PRs: + +* [Deprecate RawKeyEvent, et al. and exempt uses in the framework.][] +* [Prepare ShortcutActivator and ShortcutManager to migrate to KeyEvent from RawKeyEvent.][] + +[`debugKeyEventSimulatorTransitModeOverride`]: {{site.main-api}}/flutter/services/debugKeyEventSimulatorTransitModeOverride-class.html +[`Focus.onKey`]: {{site.main-api}}/flutter/services/Focus/onKey.html +[`FocusNode.attach`]: {{site.main-api}}/flutter/services/FocusNode/attach.html +[`FocusNode.onKey`]: {{site.main-api}}/flutter/services/FocusNode/onKey.html +[`FocusOnKeyCallback`]: {{site.main-api}}/flutter/services/FocusOnKeyCallback-class.html +[`FocusScope.onKey`]: {{site.main-api}}/flutter/services/FocusScope/onKey.html +[`FocusScopeNode.onKey`]: {{site.main-api}}/flutter/services/FocusScopeNode/onKey.html +[`GLFWKeyHelper`]: {{site.main-api}}/flutter/services/GLFWKeyHelper-class.html +[`GtkKeyHelper`]: {{site.main-api}}/flutter/services/GtkKeyHelper-class.html +[`KeyboardSide`]: {{site.main-api}}/flutter/services/KeyboardSide-class.html +[`KeyDataTransitMode`]: {{site.main-api}}/flutter/services/KeyDataTransitMode-class.html +[`KeyEventManager`]: {{site.main-api}}/flutter/services/KeyEventManager-class.html +[`KeyHelper`]: {{site.main-api}}/flutter/services/KeyHelper-class.html +[`KeyMessage`]: {{site.main-api}}/flutter/services/KeyMessage-class.html +[`KeyMessageHandler`]: {{site.main-api}}/flutter/services/KeyMessageHandler-class.html +[`KeySimulatorTransitModeVariant`]: {{site.main-api}}/flutter/services/KeySimulatorTransitModeVariant-class.html +[`ModifierKey`]: {{site.main-api}}/flutter/services/ModifierKey-class.html +[`RawKeyboard`]: {{site.main-api}}/flutter/services/RawKeyboard-class.html +[`RawKeyboardListener`]: {{site.main-api}}/flutter/services/RawKeyboardListener-class.html +[`RawKeyDownEvent`]: {{site.main-api}}/flutter/services/RawKeyDownEvent-class.html +[`RawKeyEvent`]: {{site.main-api}}/flutter/services/RawKeyEvent-class.html +[`RawKeyEventData`]: {{site.main-api}}/flutter/services/RawKeyEventData-class.html +[`RawKeyEventDataAndroid`]: {{site.main-api}}/flutter/services/RawKeyEventDataAndroid-class.html +[`RawKeyEventDataFuchsia`]: {{site.main-api}}/flutter/services/RawKeyEventDataFuchsia-class.html +[`RawKeyEventDataIos`]: {{site.main-api}}/flutter/services/RawKeyEventDataIos-class.html +[`RawKeyEventDataLinux`]: {{site.main-api}}/flutter/services/RawKeyEventDataLinux-class.html +[`RawKeyEventDataMacOs`]: {{site.main-api}}/flutter/services/RawKeyEventDataMacOs-class.html +[`RawKeyEventDataWeb`]: {{site.main-api}}/flutter/services/RawKeyEventDataWeb-class.html +[`RawKeyEventDataWindows`]: {{site.main-api}}/flutter/services/RawKeyEventDataWindows-class.html +[`RawKeyEventHandler`]: {{site.main-api}}/flutter/services/RawKeyEventHandler-class.html +[`RawKeyUpEvent`]: {{site.main-api}}/flutter/services/RawKeyUpEvent-class.html +[`ServicesBinding.keyEventManager`]: {{site.main-api}}/flutter/services/ServicesBinding/keyEventManager.html +[`Focus.onKeyEvent`]: {{site.main-api}}/flutter/services/Focus/onKeyEvent.html +[`FocusNode.onKeyEvent`]: {{site.main-api}}/flutter/services/FocusNode/onKeyEvent.html +[`FocusOnKeyEventCallback`]: {{site.main-api}}/flutter/services/FocusOnKeyEventCallback-class.html +[`FocusScope.onKeyEvent`]: {{site.main-api}}/flutter/services/FocusScope/onKeyEvent.html +[`FocusScopeNode.onKeyEvent`]: {{site.main-api}}/flutter/services/FocusScopeNode/onKeyEvent.html +[`HardwareKeyboard`]: {{site.main-api}}/flutter/services/HardwareKeyboard-class.html +[`KeyboardListener`]: {{site.main-api}}/flutter/services/KeyboardListener-class.html +[`KeyDownEvent`]: {{site.main-api}}/flutter/services/KeyDownEvent-class.html +[`KeyRepeatEvent`]: {{site.main-api}}/flutter/services/KeyRepeatEvent-class.html +[`KeyEvent`]: {{site.main-api}}/flutter/services/KeyEvent-class.html +[`KeyEventHandler`]: {{site.main-api}}/flutter/services/KeyEventHandler-class.html +[`KeyUpEvent`]: {{site.main-api}}/flutter/services/KeyUpEvent-class.html +[`RawKeyEvent.isKeyPressed`]: {{site.main-api}}/flutter/services/RawKeyEvent/isKeyPressed.html +[`RawKeyEvent.isControlPressed`]: {{site.main-api}}/flutter/services/RawKeyEvent/isControlPressed.html +[`RawKeyEvent.isShiftPressed`]: {{site.main-api}}/flutter/services/RawKeyEvent/isShiftPressed.html +[`RawKeyEvent.isAltPressed`]: {{site.main-api}}/flutter/services/RawKeyEvent/isAltPressed.html +[`RawKeyEvent.isMetaPressed`]: {{site.main-api}}/flutter/services/RawKeyEvent/isMetaPressed.html +[`RawKeyEvent.repeat`]: {{site.main-api}}/flutter/services/RawKeyEvent/repeat.html +[`RawKeyEventDataAndroid.eventSource`]: {{site.main-api}}/flutter/services/RawKeyEventDataAndroid/eventSource.html +[`KeyEvent.deviceType`]: {{site.main-api}}/flutter/services/KeyEvent/deviceType.html +[`RawKeyEvent` and `RawKeyboard`, et al should be deprecated and removed (Issue 136419)]: {{site.repo.flutter}}/issues/136419 +[Prepare ShortcutActivator and ShortcutManager to migrate to KeyEvent from RawKeyEvent.]: {{site.repo.flutter}}/pull/136854 +[Deprecate RawKeyEvent, et al. and exempt uses in the framework.]: {{site.repo.flutter}}/pull/136677 From f6f7f38cedf9ea7fa18b581312deeb49ddc3178d Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Fri, 1 Dec 2023 13:16:53 -0800 Subject: [PATCH 2/4] Updates --- .../breaking-changes/key-event-migration.md | 73 +++++++++++-------- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/src/release/breaking-changes/key-event-migration.md b/src/release/breaking-changes/key-event-migration.md index 1db8795010e..7622e4c28d5 100644 --- a/src/release/breaking-changes/key-event-migration.md +++ b/src/release/breaking-changes/key-event-migration.md @@ -19,20 +19,20 @@ framework and in client apps caused overly complex code, and the old system didn't properly represent the true state of key events on the system. [RawKeyboard] is the legacy API, and has been deprecated and will be removed in -the future. The replacements are [HardwareKeyboard] and [KeyEvent] -APIs (such as [FocusNode.onKeyEvent]). +the future. The replacements are [HardwareKeyboard] and [KeyEvent] APIs (such as +[FocusNode.onKeyEvent]). -Behavior-wise, [RawKeyboard] provided a less unified, less regular -event model than [HardwareKeyboard] does. For example: +Behavior-wise, [RawKeyboard] provided a less unified, less regular event model +than [HardwareKeyboard] does. For example: -* Down events were not always matched with an up event, and vice versa (the - set of pressed keys was silently updated). +* Down events were not always matched with an up event, and vice versa (the set + of pressed keys was silently updated). * The logical key of the down event was not always the same as that of the up event. * Down events and repeat events were not easily distinguishable (had to be tracked manually). -* Lock modes (such as CapsLock) only had their "enabled" state recorded. - There was no way to acquire their pressed state. +* Lock modes (such as CapsLock) only had their "enabled" state recorded. There + was no way to acquire their pressed state. So, the new [`KeyEvent`][]/[`HardwareKeyboard`][]-based system was born and, to minimize breaking changes, was implemented in parallel with the old system with @@ -42,14 +42,28 @@ that will occur when the deprecated APIs are removed. ## Description of change -Summary of APIs that have been deprecated: +Below are the APIs that have been deprecated. -* [`Focus.onKey`][] -* [`FocusNode.attach`][]'s `onKey` argument. -* [`FocusNode.onKey`][] -* [`FocusOnKeyCallback`][] -* [`FocusScope.onKey`][] -* [`FocusScopeNode.onKey`][] +### Deprecated APIs That Have an Equivalent + +* [`Focus.onKey`][] => [`Focus.onKeyEvent`][] +* [`FocusNode.attach`][]'s `onKey` argument => `onKeyEvent` argument +* [`FocusNode.onKey`][] => [`FocusNode.onKeyEvent`][] +* [`FocusOnKeyCallback`][] => [`FocusOnKeyEventCallback`][] +* [`FocusScope.onKey`][] => [`FocusScope.onKeyEvent`][] +* [`FocusScopeNode.onKey`][] => [`FocusScopeNode.onKeyEvent`][] +* [`RawKeyboard`][] => [`HardwareKeyboard`][] +* [`RawKeyboardListener`][] => [`KeyboardListener`][] +* [`RawKeyDownEvent`][] => [`KeyDownEvent`][] +* [`RawKeyEvent`][] => [`KeyEvent`][] +* [`RawKeyUpEvent`][] => [`KeyUpEvent`][] + +### APIs That Have Been Discontinued + +These APIs are no longer needed once there is only one key event system, or +their functionality is no longer offered. + +* [`debugKeyEventSimulatorTransitModeOverride`][] * [`GLFWKeyHelper`][] * [`GtkKeyHelper`][] * [`KeyboardSide`][] @@ -58,11 +72,8 @@ Summary of APIs that have been deprecated: * [`KeyHelper`][] * [`KeyMessage`][] * [`KeyMessageHandler`][] +* [`KeySimulatorTransitModeVariant`][] * [`ModifierKey`][] -* [`RawKeyboard`][] -* [`RawKeyboardListener`][] -* [`RawKeyDownEvent`][] -* [`RawKeyEvent`][] * [`RawKeyEventData`][] * [`RawKeyEventDataAndroid`][] * [`RawKeyEventDataFuchsia`][] @@ -72,10 +83,7 @@ Summary of APIs that have been deprecated: * [`RawKeyEventDataWeb`][] * [`RawKeyEventDataWindows`][] * [`RawKeyEventHandler`][] -* [`RawKeyUpEvent`][] * [`ServicesBinding.keyEventManager`][] -* [`KeySimulatorTransitModeVariant`][] -* [`debugKeyEventSimulatorTransitModeOverride`][] ## Migration guide @@ -88,7 +96,7 @@ For the most part, there are equivalent `KeyEvent` APIs available for all of the `RawKeyEvent` APIs. Some APIs relating to platform specific information contained in -[`RawKeyEventData`][] objects or their subclasses has been removed and is no +[`RawKeyEventData`][] objects or their subclasses have been removed and are no longer supported. One exception is that [`RawKeyEventDataAndroid.eventSource`][] information is accessible now as [`KeyEvent.deviceType`][] in a more platform independent form. @@ -98,7 +106,9 @@ platform independent form. If the legacy code used the [`RawKeyEvent.isKeyPressed`][], [`RawKeyEvent.isControlPressed`][], [`RawKeyEvent.isShiftPressed`][], [`RawKeyEvent.isAltPressed`][], or [`RawKeyEvent.isMetaPressed`][] APIs, there -are equivalent functions on the [`HardwareKeyboard`][] singleton instance. +are now equivalent functions on the [`HardwareKeyboard`][] singleton instance, +but are not available on [KeyEvent]. [`RawKeyEvent.isKeyPressed`][] is available +as [`HardwareKeyboard.isLogicalKeyPressed`][]. Before: @@ -136,9 +146,11 @@ KeyEventResult _handleKeyEvent(KeyEvent _) { #### Setting `onKey` for focus -If you were setting the `onKey` parameter of the `Focus`, `FocusScope`, -`FocusNode`, or `FocusScopeNode` classes, then there is an equivalent -`onKeyEvent` parameter that supplies `KeyEvent`s instead of `RawKeyEvent`. +If the legacy code was using the [`Focus.onKey`][], [`FocusScope.onKey`][], +[`FocusNode.onKey`][], or [`FocusScopeNode.onKey`][] parameters, then there is +an equivalent [`Focus.onKeyEvent`][], [`FocusScope.onKeyEvent`][], +[`FocusNode.onKeyEvent`][], or [`FocusScopeNode.onKeyEvent`][] parameter that +supplies `KeyEvent`s instead of `RawKeyEvent`s. ```dart Widget build(BuildContext context) { @@ -194,8 +206,8 @@ KeyEventResult _handleKeyEvent(KeyEvent _) { } ``` -Be careful to check conditionals: a `KeyRepeatEvent` is also a key down event, -but it is a different type (and it is not a subclass of `KeyDownEvent`), so +Be careful to check conditionals: a [`KeyRepeatEvent`][] is also a key down event, +but it is a different type (it is not a subclass of [`KeyDownEvent`][]), so don't assume that `keyEvent is! KeyDownEvent` only allows key up events, because both `KeyDownEvent` and `KeyRepeatEvent` need to be checked. @@ -228,7 +240,6 @@ Relevant issues: Relevant PRs: * [Deprecate RawKeyEvent, et al. and exempt uses in the framework.][] -* [Prepare ShortcutActivator and ShortcutManager to migrate to KeyEvent from RawKeyEvent.][] [`debugKeyEventSimulatorTransitModeOverride`]: {{site.main-api}}/flutter/services/debugKeyEventSimulatorTransitModeOverride-class.html [`Focus.onKey`]: {{site.main-api}}/flutter/services/Focus/onKey.html @@ -268,6 +279,7 @@ Relevant PRs: [`FocusScope.onKeyEvent`]: {{site.main-api}}/flutter/services/FocusScope/onKeyEvent.html [`FocusScopeNode.onKeyEvent`]: {{site.main-api}}/flutter/services/FocusScopeNode/onKeyEvent.html [`HardwareKeyboard`]: {{site.main-api}}/flutter/services/HardwareKeyboard-class.html +[`HardwareKeyboard.isLogicalKeyPressed`]: {{site.main-api}}/flutter/services/HardwareKeyboard/isLogicalKeyPressed.html [`KeyboardListener`]: {{site.main-api}}/flutter/services/KeyboardListener-class.html [`KeyDownEvent`]: {{site.main-api}}/flutter/services/KeyDownEvent-class.html [`KeyRepeatEvent`]: {{site.main-api}}/flutter/services/KeyRepeatEvent-class.html @@ -283,5 +295,4 @@ Relevant PRs: [`RawKeyEventDataAndroid.eventSource`]: {{site.main-api}}/flutter/services/RawKeyEventDataAndroid/eventSource.html [`KeyEvent.deviceType`]: {{site.main-api}}/flutter/services/KeyEvent/deviceType.html [`RawKeyEvent` and `RawKeyboard`, et al should be deprecated and removed (Issue 136419)]: {{site.repo.flutter}}/issues/136419 -[Prepare ShortcutActivator and ShortcutManager to migrate to KeyEvent from RawKeyEvent.]: {{site.repo.flutter}}/pull/136854 [Deprecate RawKeyEvent, et al. and exempt uses in the framework.]: {{site.repo.flutter}}/pull/136677 From 714460c30c8dfe89050dbbf6539cb6872b117fa6 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Mon, 4 Dec 2023 13:39:45 -0600 Subject: [PATCH 3/4] Update src/release/breaking-changes/key-event-migration.md --- src/release/breaking-changes/key-event-migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/release/breaking-changes/key-event-migration.md b/src/release/breaking-changes/key-event-migration.md index 7622e4c28d5..6de93e28469 100644 --- a/src/release/breaking-changes/key-event-migration.md +++ b/src/release/breaking-changes/key-event-migration.md @@ -14,7 +14,7 @@ system, and the raw system has been deprecated. ## Context -In the original key event subsystem handling each platform's quirks in the +In the original key event subsystem, handling each platform's quirks in the framework and in client apps caused overly complex code, and the old system didn't properly represent the true state of key events on the system. From be909585e1795588d717cbfd4fed93e55da986af Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 5 Dec 2023 11:42:13 -0800 Subject: [PATCH 4/4] Update from review --- src/release/breaking-changes/index.md | 4 ++-- src/release/breaking-changes/key-event-migration.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/release/breaking-changes/index.md b/src/release/breaking-changes/index.md index 6e03b811808..0ad708e4253 100644 --- a/src/release/breaking-changes/index.md +++ b/src/release/breaking-changes/index.md @@ -31,15 +31,16 @@ release, and listed in alphabetical order: ### Not yet released to stable +* [Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system][] * [Deprecate `TextField.canRequestFocus`][] * [Accessibility traversal order of tooltip changed][] +[Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system]: {{site.url}}/release/breaking-changes/key-event-migration [Deprecate `TextField.canRequestFocus`]: {{site.url}}/release/breaking-changes/can-request-focus [Accessibility traversal order of tooltip changed]: {{site.url}}/release/breaking-changes/tooltip-semantics-order ### Released in Flutter 3.16 -* [Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system][] * [Migrate ShortcutActivator and ShortcutManager to KeyEvent system][] * [The `ThemeData.useMaterial3` property is now set to true by default][] * [Deprecated API removed after v3.13][] @@ -53,7 +54,6 @@ release, and listed in alphabetical order: * [Windows: External windows should notify Flutter engine of lifecycle changes][] * [Windows build path changed to add the target architecture][] -[Migrate RawKeyEvent/RawKeyboard system to KeyEvent/HardwareKeyboard system]: {{site.url}}/release/breaking-changes/key-event-migration [Migrate ShortcutActivator and ShortcutManager to KeyEvent system]: {{site.url}}/release/breaking-changes/shortcut-key-event-migration [The `ThemeData.useMaterial3` property is now set to true by default]: {{site.url}}/release/breaking-changes/material-3-default [Deprecated API removed after v3.13]: {{site.url}}/release/breaking-changes/3-13-deprecations diff --git a/src/release/breaking-changes/key-event-migration.md b/src/release/breaking-changes/key-event-migration.md index 6de93e28469..bd31caff47e 100644 --- a/src/release/breaking-changes/key-event-migration.md +++ b/src/release/breaking-changes/key-event-migration.md @@ -213,8 +213,8 @@ both `KeyDownEvent` and `KeyRepeatEvent` need to be checked. ## Timeline -Landed in version: 3.17.0-18.0.pre
-In stable release: not yet (Not in 3.17) +Landed in version: 3.18.0-2.0.pre
+In stable release: not yet (Not in 3.18) ## References