chordBindings function
Extracts chord bindings from keyMap for use with KeyChordInterceptor.
final interceptor = KeyChordInterceptor(
bindings: chordBindings(myKeyMap),
);
Implementation
List<KeyChordBinding> chordBindings(KeyMap keyMap) {
final chords = keyMap.chords;
if (chords == null || chords.isEmpty) return [];
return [
for (final c in chords)
KeyChordBinding(id: c.id, prefix: c.prefix, key: c.key),
];
}