copyWith method

Key copyWith({
  1. KeyType? type,
  2. List<int>? runes,
  3. bool? ctrl,
  4. bool? alt,
  5. bool? shift,
  6. bool? isRelease,
  7. bool? isRepeat,
})

Creates a copy of this key with the given fields replaced.

Implementation

Key copyWith({
  KeyType? type,
  List<int>? runes,
  bool? ctrl,
  bool? alt,
  bool? shift,
  bool? isRelease,
  bool? isRepeat,
}) {
  return Key(
    type ?? this.type,
    runes: runes ?? this.runes,
    ctrl: ctrl ?? this.ctrl,
    alt: alt ?? this.alt,
    shift: shift ?? this.shift,
    isRelease: isRelease ?? this.isRelease,
    isRepeat: isRepeat ?? this.isRepeat,
  );
}