hotkey_manager icon indicating copy to clipboard operation
hotkey_manager copied to clipboard

Migrate to new HardwareKeyboard class

Open shidenggui opened this issue 1 year ago • 0 comments

hotkey_manger now use the depreacted RawKeyboard class, the new class is HardwareKeyboard page.

And I found some bugs about RawKeyboard that official has said below:

Compared to RawKeyboard RawKeyboard is the legacy API, and will be deprecated and removed in the future. It is recommended to always use HardwareKeyboard and KeyEvent APIs (such as FocusNode.onKeyEvent) to handle key events.

Behavior-wise, RawKeyboard provides a less unified, less regular event model than HardwareKeyboard. For example:

  • Down events might not be matched with an up event, and vice versa (the set of pressed keys is silently updated).
  • The logical key of the down event might not be the same as that of the up event.
  • Down events and repeat events are not easily distinguishable (must be tracked manually).
  • Lock modes (such as CapsLock) only have their "enabled" state recorded. There's no way to acquire their pressing state.

shidenggui avatar Aug 26 '22 09:08 shidenggui