getPlatformKeyCode method

int? getPlatformKeyCode(
  1. KeyboardKey key
)

Returns the platform specific key code for given KeyboardKey for this keyboard layout or null if the code could not have been determined.

Implementation

int? getPlatformKeyCode(KeyboardKey key) {
  if (key is PhysicalKeyboardKey) {
    return _physicalToKey[key.usbHidUsage]?.platform;
  } else if (key is LogicalKeyboardKey) {
    return _logicalToKey[key.keyId]?.platform;
  } else {
    return null;
  }
}