KeyAction.fromString constructor

KeyAction.fromString(
  1. String string,
  2. String description,
  3. VoidCallback callback, {
  4. String? categoryHeader,
  5. bool isControlPressed = false,
  6. bool isMetaPressed = false,
  7. bool isShiftPressed = false,
  8. bool isAltPressed = false,
})

Creates a key action from the first letter of any string string with, description and callback method. Includes optional bool values (defaulting to false) for key modifiers for meta isMetaPressed, shift isShiftPressed, alt isAltPressed

Implementation

KeyAction.fromString(String string, this.description, this.callback,
{this.categoryHeader, bool isControlPressed = false, bool isMetaPressed = false,
bool isShiftPressed = false, bool isAltPressed = false}) :
  keyActivator = SingleActivator(LogicalKeyboardKey(string.toLowerCase().codeUnitAt(0)),
  control: isControlPressed, shift: isShiftPressed, alt: isAltPressed, meta: isMetaPressed);