Map<String, dynamic> toJson() { return { 'keyCode': keyCode.stringValue, 'modifiers': modifiers?.map((e) => e.stringValue).toList() ?? [], 'identifier': identifier, 'scope': describeEnum(scope), }; }