SuggestKeyMap constructor
SuggestKeyMap({
- KeyBinding? moveUp,
- KeyBinding? moveDown,
- KeyBinding? moveFirst,
- KeyBinding? moveLast,
- KeyBinding? accept,
- KeyBinding? deleteBackward,
- KeyBinding? moveCursorLeft,
- KeyBinding? moveCursorRight,
- KeyBinding? cancel,
Creates a key map with default bindings.
Implementation
SuggestKeyMap({
KeyBinding? moveUp,
KeyBinding? moveDown,
KeyBinding? moveFirst,
KeyBinding? moveLast,
KeyBinding? accept,
KeyBinding? deleteBackward,
KeyBinding? moveCursorLeft,
KeyBinding? moveCursorRight,
KeyBinding? cancel,
}) : moveUp =
moveUp ??
KeyBinding(
keys: ['up', 'ctrl+p', 'shift+tab'],
help: Help(key: '↑', desc: 'up'),
),
moveDown =
moveDown ??
KeyBinding(
keys: ['down', 'ctrl+n', 'tab'],
help: Help(key: '↓', desc: 'down'),
),
moveFirst =
moveFirst ??
KeyBinding(
keys: ['ctrl+a', 'home'],
help: Help(key: 'home', desc: 'first'),
),
moveLast =
moveLast ??
KeyBinding(
keys: ['ctrl+e', 'end'],
help: Help(key: 'end', desc: 'last'),
),
accept =
accept ??
KeyBinding(
keys: ['enter'],
help: Help(key: '↵', desc: 'accept'),
),
deleteBackward =
deleteBackward ??
KeyBinding(
keys: ['backspace', 'ctrl+h'],
help: Help(key: '⌫', desc: 'delete'),
),
moveCursorLeft =
moveCursorLeft ??
KeyBinding(
keys: ['left', 'ctrl+b'],
help: Help(key: '←', desc: 'cursor left'),
),
moveCursorRight =
moveCursorRight ??
KeyBinding(
keys: ['right', 'ctrl+f'],
help: Help(key: '→', desc: 'cursor right'),
),
cancel =
cancel ??
KeyBinding(
keys: ['esc', 'ctrl+c'],
help: Help(key: 'esc', desc: 'cancel'),
);