Implementation
@override
Tool get definition => Tool(
name: 'key',
description: 'Press a non-printing key: backspace, delete, enter, tab, escape, '
'space, up, down, left, right, or back (the system back, as hardware_button back). count repeats it (1-50); modifiers '
'holds cmd / shift / ctrl / alt around it. Sends to the focused '
'field, so focus one first (type focus:<id> or tap it). Returns '
'changed / changeCategory like type. To empty a field use '
'type clear:true. errorKind: invalidArgument (bad key / count / '
'modifier), flutterModeRequired (device mode has no scene), '
'unsupportedBackendAction (backend has no keyboard).',
inputSchema: ObjectSchema(
properties: {
'key': Schema.string(
description: 'One of: ${KeyName.values.map((k) => k.name).join(', ')}, back.',
),
'count': Schema.int(description: 'Times to press it (1-50). Default 1.'),
'modifiers': Schema.list(
items: Schema.string(),
description: 'Held around the key: ${KeyModifier.values.map((m) => m.name).join(', ')}.',
),
'returnScene': Schema.bool(
description: 'Read the post-press scene for changed. Default true.',
),
},
required: ['key'],
),
);