androidMetaState function

int androidMetaState(
  1. Set<KeyModifier> modifiers
)

KeyEvent meta state for modifiers, with the left-hand flag each key event carries.

Implementation

int androidMetaState(Set<KeyModifier> modifiers) {
  var meta = 0;
  for (final m in modifiers) {
    meta |= switch (m) {
      KeyModifier.shift => 0x1 | 0x40,
      KeyModifier.alt => 0x2 | 0x10,
      KeyModifier.ctrl => 0x1000 | 0x2000,
      KeyModifier.cmd => 0x10000 | 0x20000,
    };
  }
  return meta;
}