@@ -585,13 +585,32 @@ typedef RawKeyEventHandler = bool Function(RawKeyEvent event);
585585/// These key events are typically only key events generated by a hardware
586586/// keyboard, and not those from software keyboards or input method editors.
587587///
588+ /// ## Compared to [HardwareKeyboard]
589+ ///
590+ /// [RawKeyboard] is the legacy API, and will be deprecated and removed in the
591+ /// future. It is recommended to always use [HardwareKeyboard] and [KeyEvent]
592+ /// APIs (such as [FocusNode.onKeyEvent] ) to handle key events.
593+ ///
594+ /// Behavior-wise, [RawKeyboard] provides a less unified, less regular
595+ /// event model than [HardwareKeyboard] . For example:
596+ ///
597+ /// * Down events might not be matched with an up event, and vice versa (the
598+ /// set of pressed keys is silently updated).
599+ /// * The logical key of the down event might not be the same as that of the up
600+ /// event.
601+ /// * Down events and repeat events are not easily distinguishable (must be
602+ /// tracked manually).
603+ /// * Lock modes (such as CapsLock) only have their "enabled" state recorded.
604+ /// There's no way to acquire their pressing state.
605+ ///
588606/// See also:
589607///
590608/// * [RawKeyDownEvent] and [RawKeyUpEvent] , the classes used to describe
591609/// specific raw key events.
592610/// * [RawKeyboardListener] , a widget that listens for raw key events.
593611/// * [SystemChannels.keyEvent] , the low-level channel used for receiving
594612/// events from the system.
613+ /// * [HardwareKeyboard] , the recommended replacement.
595614class RawKeyboard {
596615 RawKeyboard ._();
597616
0 commit comments