- logicalKey
These represent logical keys, which are keys which are interpreted in the context of any modifiers, modes, or keyboard layouts which may be in effect.
This is contrast to PhysicalKeyboardKey, which represents a physical key in a particular location on the keyboard, without regard for the modifier state, mode, or keyboard layout.
As an example, if you wanted to implement an app where the "Q" key "quit" something, you'd want to look at the logical key to detect this, since you would > like to have it match the key with "Q" on it, instead of always looking for "the key next to the TAB key", since on a French keyboard, the key next to the > TAB key has an "A" on it.
Conversely, if you wanted a game where the key next to the CAPS LOCK (the "A" key on a QWERTY keyboard) moved the player to the left, you'd want to look
at the physical key to make sure that regardless of the character the key produces, you got the key that is in that location on the keyboard.
- physicalKey
These represent physical keys, which are keys which represent a particular key location on a QWERTY keyboard. It ignores any modifiers, modes, or keyboard layouts which may be in effect. This is contrast to LogicalKeyboardKey, which represents a logical key interpreted in the context of modifiers, modes, and/or keyboard layouts.PhysicalKeyboardKeys are used to describe and test for keys in a particular location.
As an example, if you wanted a game where the key next to the CAPS LOCK (the "A" key on a QWERTY keyboard) moved the player to the left, you'd want to look at the physical key to make sure that regardless of the character the key produces, you got the key that is in that location on the keyboard.
Conversely, if you wanted to implement an app where the "Q" key "quit" something, you'd want to look at the logical key to detect this, since you would like to have it match the key with "Q" on it, instead of always looking for "the key next to the TAB key", since on a French keyboard, the key next to the TAB key has an "A" on it.
abstract from https://api.flutter.dev/flutter/services/KeyboardKey-class.html
标签:keys,logicalKey,logical,next,location,key,keyboard,flutter,physicalKey From: https://www.cnblogs.com/sqmw/p/17029801.html