|
@@ -58,116 +58,146 @@ List<ShortcutEvent> builtInShortcutEvents = [
|
|
key: 'Move cursor top',
|
|
key: 'Move cursor top',
|
|
command: 'meta+arrow up',
|
|
command: 'meta+arrow up',
|
|
windowsCommand: 'ctrl+arrow up',
|
|
windowsCommand: 'ctrl+arrow up',
|
|
|
|
+ linuxCommand: 'ctrl+arrow up',
|
|
handler: cursorTop,
|
|
handler: cursorTop,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Move cursor bottom',
|
|
key: 'Move cursor bottom',
|
|
command: 'meta+arrow down',
|
|
command: 'meta+arrow down',
|
|
windowsCommand: 'ctrl+arrow down',
|
|
windowsCommand: 'ctrl+arrow down',
|
|
|
|
+ linuxCommand: 'ctrl+arrow down',
|
|
handler: cursorBottom,
|
|
handler: cursorBottom,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Move cursor begin',
|
|
key: 'Move cursor begin',
|
|
command: 'meta+arrow left',
|
|
command: 'meta+arrow left',
|
|
windowsCommand: 'ctrl+arrow left',
|
|
windowsCommand: 'ctrl+arrow left',
|
|
|
|
+ linuxCommand: 'ctrl+arrow left',
|
|
handler: cursorBegin,
|
|
handler: cursorBegin,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Move cursor end',
|
|
key: 'Move cursor end',
|
|
command: 'meta+arrow right',
|
|
command: 'meta+arrow right',
|
|
windowsCommand: 'ctrl+arrow right',
|
|
windowsCommand: 'ctrl+arrow right',
|
|
|
|
+ linuxCommand: 'ctrl+arrow right',
|
|
handler: cursorEnd,
|
|
handler: cursorEnd,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Cursor top select',
|
|
key: 'Cursor top select',
|
|
command: 'meta+shift+arrow up',
|
|
command: 'meta+shift+arrow up',
|
|
windowsCommand: 'ctrl+shift+arrow up',
|
|
windowsCommand: 'ctrl+shift+arrow up',
|
|
|
|
+ linuxCommand: 'ctrl+shift+arrow up',
|
|
handler: cursorTopSelect,
|
|
handler: cursorTopSelect,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Cursor bottom select',
|
|
key: 'Cursor bottom select',
|
|
command: 'meta+shift+arrow down',
|
|
command: 'meta+shift+arrow down',
|
|
windowsCommand: 'ctrl+shift+arrow down',
|
|
windowsCommand: 'ctrl+shift+arrow down',
|
|
|
|
+ linuxCommand: 'ctrl+shift+arrow down',
|
|
handler: cursorBottomSelect,
|
|
handler: cursorBottomSelect,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Cursor begin select',
|
|
key: 'Cursor begin select',
|
|
command: 'meta+shift+arrow left',
|
|
command: 'meta+shift+arrow left',
|
|
windowsCommand: 'ctrl+shift+arrow left',
|
|
windowsCommand: 'ctrl+shift+arrow left',
|
|
|
|
+ linuxCommand: 'ctrl+shift+arrow left',
|
|
handler: cursorBeginSelect,
|
|
handler: cursorBeginSelect,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Cursor end select',
|
|
key: 'Cursor end select',
|
|
command: 'meta+shift+arrow right',
|
|
command: 'meta+shift+arrow right',
|
|
windowsCommand: 'ctrl+shift+arrow right',
|
|
windowsCommand: 'ctrl+shift+arrow right',
|
|
|
|
+ linuxCommand: 'ctrl+shift+arrow right',
|
|
handler: cursorEndSelect,
|
|
handler: cursorEndSelect,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Redo',
|
|
key: 'Redo',
|
|
command: 'meta+shift+z',
|
|
command: 'meta+shift+z',
|
|
windowsCommand: 'ctrl+shift+z',
|
|
windowsCommand: 'ctrl+shift+z',
|
|
|
|
+ linuxCommand: 'ctrl+shift+z',
|
|
handler: redoEventHandler,
|
|
handler: redoEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Undo',
|
|
key: 'Undo',
|
|
command: 'meta+z',
|
|
command: 'meta+z',
|
|
windowsCommand: 'ctrl+z',
|
|
windowsCommand: 'ctrl+z',
|
|
|
|
+ linuxCommand: 'ctrl+z',
|
|
handler: undoEventHandler,
|
|
handler: undoEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format bold',
|
|
key: 'Format bold',
|
|
command: 'meta+b',
|
|
command: 'meta+b',
|
|
windowsCommand: 'ctrl+b',
|
|
windowsCommand: 'ctrl+b',
|
|
|
|
+ linuxCommand: 'ctrl+b',
|
|
handler: formatBoldEventHandler,
|
|
handler: formatBoldEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format italic',
|
|
key: 'Format italic',
|
|
command: 'meta+i',
|
|
command: 'meta+i',
|
|
windowsCommand: 'ctrl+i',
|
|
windowsCommand: 'ctrl+i',
|
|
|
|
+ linuxCommand: 'ctrl+i',
|
|
handler: formatItalicEventHandler,
|
|
handler: formatItalicEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format underline',
|
|
key: 'Format underline',
|
|
command: 'meta+u',
|
|
command: 'meta+u',
|
|
windowsCommand: 'ctrl+u',
|
|
windowsCommand: 'ctrl+u',
|
|
|
|
+ linuxCommand: 'ctrl+u',
|
|
handler: formatUnderlineEventHandler,
|
|
handler: formatUnderlineEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format strikethrough',
|
|
key: 'Format strikethrough',
|
|
command: 'meta+shift+s',
|
|
command: 'meta+shift+s',
|
|
windowsCommand: 'ctrl+shift+s',
|
|
windowsCommand: 'ctrl+shift+s',
|
|
|
|
+ linuxCommand: 'ctrl+shift+s',
|
|
handler: formatStrikethroughEventHandler,
|
|
handler: formatStrikethroughEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format highlight',
|
|
key: 'Format highlight',
|
|
command: 'meta+shift+h',
|
|
command: 'meta+shift+h',
|
|
windowsCommand: 'ctrl+shift+h',
|
|
windowsCommand: 'ctrl+shift+h',
|
|
|
|
+ linuxCommand: 'ctrl+shift+h',
|
|
handler: formatHighlightEventHandler,
|
|
handler: formatHighlightEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Format link',
|
|
key: 'Format link',
|
|
command: 'meta+k',
|
|
command: 'meta+k',
|
|
windowsCommand: 'ctrl+k',
|
|
windowsCommand: 'ctrl+k',
|
|
|
|
+ linuxCommand: 'ctrl+k',
|
|
handler: formatLinkEventHandler,
|
|
handler: formatLinkEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Copy',
|
|
key: 'Copy',
|
|
command: 'meta+c',
|
|
command: 'meta+c',
|
|
windowsCommand: 'ctrl+c',
|
|
windowsCommand: 'ctrl+c',
|
|
|
|
+ linuxCommand: 'ctrl+c',
|
|
handler: copyEventHandler,
|
|
handler: copyEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Paste',
|
|
key: 'Paste',
|
|
command: 'meta+v',
|
|
command: 'meta+v',
|
|
windowsCommand: 'ctrl+v',
|
|
windowsCommand: 'ctrl+v',
|
|
|
|
+ linuxCommand: 'ctrl+v',
|
|
handler: pasteEventHandler,
|
|
handler: pasteEventHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
- key: 'Paste',
|
|
|
|
|
|
+ key: 'Cut',
|
|
command: 'meta+x',
|
|
command: 'meta+x',
|
|
windowsCommand: 'ctrl+x',
|
|
windowsCommand: 'ctrl+x',
|
|
|
|
+ linuxCommand: 'ctrl+x',
|
|
handler: cutEventHandler,
|
|
handler: cutEventHandler,
|
|
),
|
|
),
|
|
|
|
+ ShortcutEvent(
|
|
|
|
+ key: 'Home',
|
|
|
|
+ command: 'home',
|
|
|
|
+ handler: cursorBegin,
|
|
|
|
+ ),
|
|
|
|
+ ShortcutEvent(
|
|
|
|
+ key: 'End',
|
|
|
|
+ command: 'end',
|
|
|
|
+ handler: cursorEnd,
|
|
|
|
+ ),
|
|
|
|
+
|
|
// TODO: split the keys.
|
|
// TODO: split the keys.
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|
|
key: 'Delete Text',
|
|
key: 'Delete Text',
|
|
@@ -193,6 +223,7 @@ List<ShortcutEvent> builtInShortcutEvents = [
|
|
key: 'select all',
|
|
key: 'select all',
|
|
command: 'meta+a',
|
|
command: 'meta+a',
|
|
windowsCommand: 'ctrl+a',
|
|
windowsCommand: 'ctrl+a',
|
|
|
|
+ linuxCommand: 'ctrl+a',
|
|
handler: selectAllHandler,
|
|
handler: selectAllHandler,
|
|
),
|
|
),
|
|
ShortcutEvent(
|
|
ShortcutEvent(
|