[Libreoffice-commits] online.git: loleaflet/src

László Németh laszlo.nemeth at collabora.com
Wed Oct 28 11:36:36 PDT 2015


 loleaflet/src/map/handler/Map.Keyboard.js |   59 ++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

New commits:
commit 519084aa37a38723bf50f73d1262259938dc11b6
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Wed Oct 28 19:22:48 2015 +0100

    tdf#94608 add more keyboard shortcuts
    
    Ctrl-0  Text Body
    Ctrl-1  Heading 1
    Ctrl-2  Heading 2
    Ctrl-3  Heading 3
    Ctrl-4  Heading 4
    Ctrl-5  Heading 5
    Ctrl-, or Ctrl-Shift-b Subscript
    Ctrl-. or Ctrl-Shift-p Superscript
    Ctrl-Space or Ctrl-m   Clear direct formatting
    Ctrl-Alt-F  Insert footnote
    Ctrl-Alt-m or Ctrl-Alt-c  Insert comment

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index f3b212b..4b17a6a 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -252,16 +252,69 @@ L.Map.Keyboard = L.Handler.extend({
 			return;
 		};
 
+		if (e.originalEvent.altKey || e.originalEvent.shiftKey) {
+
+			// Ctrl + Alt
+			if (!e.originalEvent.shiftKey) {
+				switch (e.originalEvent.keyCode) {
+					case 70: // f
+						L.Socket.sendMessage('uno .uno:InsertFootnote');
+						break;
+					case 67: // c
+					case 77: // m
+						L.Socket.sendMessage('uno .uno:InsertAnnotation');
+						break;
+				}
+			}
+
+			// Ctrl + Shift
+			if (!e.originalEvent.altKey) {
+				switch (e.originalEvent.keyCode) {
+					case 66: // b
+						L.Socket.sendMessage('uno .uno:SubScript');
+						break;
+					case 80: // p
+						L.Socket.sendMessage('uno .uno:SuperScript');
+						break;
+				}
+			}
+
+			e.originalEvent.preventDefault();
+			return;
+		}
+
 		switch (e.originalEvent.keyCode) {
 			case 13: // enter
 				L.Socket.sendMessage('uno .uno:InsertPagebreak');
 				break;
+			case 32: // space
+			case 77: // m
+				L.Socket.sendMessage('uno .uno:ResetAttributes');
+				break;
 			case 37: // left arrow
 				L.Socket.sendMessage('uno .uno:GoToPrevWord');
 				break;
 			case 39: // right arrow
 				L.Socket.sendMessage('uno .uno:GoToNextWord');
 				break;
+			case 48: // 0
+				this._map.applyStyle("Text body", "ParagraphStyles");
+				break;
+			case 49: // 1
+				this._map.applyStyle("Heading 1", "ParagraphStyles");
+				break;
+			case 50: // 2
+				this._map.applyStyle("Heading 2", "ParagraphStyles");
+				break;
+			case 51: // 3
+				this._map.applyStyle("Heading 3", "ParagraphStyles");
+				break;
+			case 52: // 2
+				this._map.applyStyle("Heading 4", "ParagraphStyles");
+				break;
+			case 53: // 2
+				this._map.applyStyle("Heading 5", "ParagraphStyles");
+				break;
 			case 65: // a
 				L.Socket.sendMessage('uno .uno:Selectall');
 				break;
@@ -298,9 +351,15 @@ L.Map.Keyboard = L.Handler.extend({
 			case 90: // z
 				L.Socket.sendMessage('uno .uno:Undo');
 				break;
+			case 188: // ,
+				L.Socket.sendMessage('uno .uno:SubScript');
+				break;
 			case 189: // -
 				L.Socket.sendMessage('uno .uno:InsertSoftHyphen');
 				break;
+			case 190: // .
+				L.Socket.sendMessage('uno .uno:SuperScript');
+				break;
 		}
 		if (e.originalEvent.keyCode !== 67 && e.originalEvent.keyCode !== 86 && e.originalEvent.key !== 'c' && e.originalEvent.key !== 'v') {
 			// not copy or paste


More information about the Libreoffice-commits mailing list