Added CTRL + ALT + N shortcut.

* This sends the UI_CreateFile postmessage to integrator along with the document type.
* Integrator should handle the message.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I75d78a2d37876af7233025233ab7f1b3515442a3
This commit is contained in:
Gökay Şatır 2023-10-03 16:46:19 +03:00 committed by Gökay ŞATIR
parent e2b64a71a7
commit aa0c4dbc7a

View file

@ -734,6 +734,13 @@ L.Map.Keyboard = L.Handler.extend({
e.preventDefault();
}
// CTRL + ALT + N for new document. This needs to be handled by the integrator.
if (this._isCtrlKey(e) && e.altKey && e.key.toUpperCase() === 'N') {
this._map.fire('postMessage', {msgId: 'UI_CreateFile', args: { DocumentType: this._map.getDocType() }});
e.preventDefault();
return true;
}
// CTRL + SHIFT + L is added to the core side for writer. Others can also be checked.
if (this._isCtrlKey(e) && e.shiftKey && e.key === 'L' && this._map.getDocType() !== 'text' && this._map.getDocType() !== 'spreadsheet') {
app.socket.sendMessage('uno .uno:DefaultBullet');