fromLogicalKey static method

KeyCode? fromLogicalKey(
  1. LogicalKeyboardKey logicalKey
)

Implementation

static KeyCode? fromLogicalKey(LogicalKeyboardKey logicalKey) {
  List<int> logicalKeyIdList =
      _knownLogicalKeys.values.map((e) => e.keyId).toList();
  if (!logicalKeyIdList.contains(logicalKey.keyId)) return null;

  return _knownLogicalKeys.entries
      .firstWhere((entry) => entry.value.keyId == logicalKey.keyId)
      .key;
}