onKeyDown method

bool onKeyDown(
  1. String key,
  2. String code, {
  3. required bool shift,
  4. required bool altOpt,
  5. required bool ctrl,
  6. required bool meta,
})

If this Layer is active (top-most) and accepting inputs, any keyboard key down events not handled by the higher-level Layer.onInput handler will be passed here by the bound UserInterface.

The given key is the value of the key that's down, taking into consideration all of the modifiers that are also active (shift, altOpt, ctrl, and meta). The given code is the value of the physical keyboard key that's down, ignoring keyboard layout and modifiers.

Return true to indicate that this layer consumed the key down event.

Implementation

bool onKeyDown(String key, String code,
        {required bool shift,
        required bool altOpt,
        required bool ctrl,
        required bool meta}) =>
    false;