Using Word or Writer one can insert a page break by pressing Ctrl + Enter (Windows) or Cmd + Enter (Mac). Would you be open to adding an event 'newpage' (similar to the existing 'newline') to the dispatcher here
|
.on('shiftEnter', function (event) { |
|
event.preventDefault() |
|
event.stopPropagation() |
|
const cursor = self.selectionWatcher.forceCursor() |
|
self.notify('newline', this, cursor) |
|
}) |
which refines the
key.enter event here
|
case this.key.enter: |
|
if (event.shiftKey) return this.notify(target, 'shiftEnter', event) |
|
return this.notify(target, 'enter', event) |
with
if (event.shiftKey) return this.notify(target, 'shiftEnter', event)
else if (navigator.platform.startsWith('Win') and event.ctrlKey) return this.notify(target, 'cmdEnter', event)
else if (event.metaKey) return this.notify(target, 'cmdEnter', event)
Happy to provide a PR with tests and documentation.
Using Word or Writer one can insert a page break by pressing Ctrl + Enter (Windows) or Cmd + Enter (Mac). Would you be open to adding an event
'newpage'(similar to the existing'newline') to the dispatcher hereeditable.js/src/dispatcher.js
Lines 271 to 276 in 974196a
key.enterevent hereeditable.js/src/keyboard.js
Lines 45 to 47 in 974196a
Happy to provide a PR with tests and documentation.