Skip to content

Commit

Permalink
Develop shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolcooo committed Dec 12, 2024
1 parent f823a1a commit ba01cef
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 53 deletions.
8 changes: 4 additions & 4 deletions tests/word/shortcuts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
moveToPreviousCell : 8,
selectNextObject : 9,
selectPreviousObject : 10,
testIndent : 11,
testUnIndent : 12,
BeginIndent : 11,
BeginUnIndent : 12,
addTabToParagraph : 13,
visitHyperlink : 14,
addBreakLineInlineLvlSdt : 15,
Expand Down Expand Up @@ -153,8 +153,8 @@
testHotkeyEvents[testHotkeyActions.moveToPreviousCell] = [CreateTestEvent(9, false, true, false, false)];
testHotkeyEvents[testHotkeyActions.selectNextObject] = [CreateTestEvent(9, false, false, false, false)];
testHotkeyEvents[testHotkeyActions.selectPreviousObject] = [CreateTestEvent(9, false, true, false, false)];
testHotkeyEvents[testHotkeyActions.testIndent] = [CreateTestEvent(9, false, false, false, false)];
testHotkeyEvents[testHotkeyActions.testUnIndent] = [CreateTestEvent(9, false, true, false, false)];
testHotkeyEvents[testHotkeyActions.BeginIndent] = [CreateTestEvent(9, false, false, false, false)];
testHotkeyEvents[testHotkeyActions.BeginUnIndent] = [CreateTestEvent(9, false, true, false, false)];
testHotkeyEvents[testHotkeyActions.addTabToParagraph] = [CreateTestEvent(9, false, false, false)];
testHotkeyEvents[testHotkeyActions.visitHyperlink] = [CreateTestEvent(13, false, false, false, false, false)];
testHotkeyEvents[testHotkeyActions.addBreakLineInlineLvlSdt] = [CreateTestEvent(13, false, false, false, false, false)];
Expand Down
4 changes: 2 additions & 2 deletions tests/word/shortcuts/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,10 @@

logicDocument.SelectAll();

ExecuteHotkey(testHotkeyActions.testIndent);
ExecuteHotkey(testHotkeyActions.BeginIndent);
assert.strictEqual(GetDirectParaPr().GetIndLeft(), 12.5, "Check multi indent");

ExecuteHotkey(testHotkeyActions.testUnIndent);
ExecuteHotkey(testHotkeyActions.BeginUnIndent);
assert.strictEqual(GetDirectParaPr().GetIndLeft(), 0, "Check multi unindent");
});

Expand Down
37 changes: 37 additions & 0 deletions word/Editor/Shortcuts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/

(function (undefined) {
const ShortcutActionKeycodes = {};


})();
178 changes: 131 additions & 47 deletions word/apiDefines.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,53 +209,137 @@ var c_oAscSdtCheckBoxDefaults = {
window["flat_desine"] = false;

var c_oAscDocumentShortcutType = {
InsertPageBreak : 1,
InsertLineBreak : 2,
InsertColumnBreak : 3,
ResetChar : 4,
NonBreakingSpace : 5,
ApplyHeading1 : 6,
ApplyHeading2 : 7,
ApplyHeading3 : 8,
Strikeout : 9,
ShowAll : 10, // Показать/скрыть непечатаемые символы
EditSelectAll : 11,
Bold : 12,
CopyFormat : 13,
CopyrightSign : 14,
InsertEndnoteNow : 15,
CenterPara : 16,
EuroSign : 17,
InsertFootnoteNow : 18,
Italic : 19,
JustifyPara : 20,
InsertHyperlink : 21,
ApplyListBullet : 22,
LeftPara : 23,
Indent : 24,
UnIndent : 25,
PrintPreviewAndPrint : 26,
InsertPageNumber : 27,
RegisteredSign : 28,
RightPara : 29,
Save : 30,
TrademarkSign : 31,
Underline : 32,
PasteFormat : 33,
EditUndo : 34,
EditRedo : 35,
EmDash : 36,
EnDash : 37,
UpdateFields : 38,
InsertEquation : 39,
Superscript : 40,
NonBreakingHyphen : 41,
SoftHyphen : 42,
HorizontalEllipsis : 43,
Subscript : 44,
IncreaseFontSize : 45,
DecreaseFontSize : 46,
SpeechWorker : 47
InsertPageBreak : 1,
InsertLineBreak : 2,
InsertColumnBreak : 3,
ResetChar : 4,
NonBreakingSpace : 5,
ApplyHeading1 : 6,
ApplyHeading2 : 7,
ApplyHeading3 : 8,
Strikeout : 9,
ShowAll : 10, // Показать/скрыть непечатаемые символы
EditSelectAll : 11,
Bold : 12,
CopyFormat : 13,
CopyrightSign : 14,
InsertEndnoteNow : 15,
CenterPara : 16,
EuroSign : 17,
InsertFootnoteNow : 18,
Italic : 19,
JustifyPara : 20,
InsertHyperlink : 21,
ApplyListBullet : 22,
LeftPara : 23,
Indent : 24,
UnIndent : 25,
PrintPreviewAndPrint : 26,
InsertPageNumber : 27,
RegisteredSign : 28,
RightPara : 29,
Save : 30,
TrademarkSign : 31,
Underline : 32,
PasteFormat : 33,
EditUndo : 34,
EditRedo : 35,
EmDash : 36,
EnDash : 37,
UpdateFields : 38,
InsertEquation : 39,
Superscript : 40,
NonBreakingHyphen : 41,
SoftHyphen : 42,
HorizontalEllipsis : 43,
Subscript : 44,
IncreaseFontSize : 45,
DecreaseFontSize : 46,
SpeechWorker : 47,
RemoveBackSymbol : 48,
RemoveBackWord : 49,
RemoveShape : 50,
RemoveForm : 51,
MoveToNextForm : 52,
MoveToPreviousForm : 53,
HandleTab : 54,
MoveToNextCell : 55,
MoveToPreviousCell : 56,
SelectNextObject : 57,
SelectPreviousObject : 58,
BeginIndent : 59,
BeginUnIndent : 60,
AddTabToParagraph : 61,
VisitHyperlink : 62,
AddBreakLineInlineLvlSdt : 63,
CreateTextBoxContent : 64,
CreateTextBody : 65,
AddNewLineToMath : 66,
moveCursorToStartPositionShapeEnter: 67,
selectAllShapeEnter : 68,
selectAllInChartTitle : 69,
addNewParagraphContent : 70,
addNewParagraphMath : 71,
closeAllWindowsPopups : 72,
resetShapeSelection : 73,
resetStartAddShape : 74,
resetFormattingByExample : 75,
resetMarkerFormat : 76,
resetDragNDrop : 77,
endEditing : 78,
toggleCheckBox : 79,
pageUp : 80,
pageDown : 81,
moveToEndDocument : 82,
moveToEndLine : 83,
selectToEndDocument : 84,
selectToEndLine : 85,
selectToStartLine : 86,
selectToStartDocument : 87,
moveToStartLine : 88,
moveToStartDocument : 89,
selectLeftWord : 90,
moveToLeftWord : 91,
selectLeftChar : 92,
moveToLeftChar : 93,
moveToRightChar : 94,
selectRightChar : 95,
moveToRightWord : 96,
selectRightWord : 97,
moveUp : 98,
selectUp : 99,
previousOptionComboBox : 100,
moveDown : 101,
selectDown : 102,
nextOptionComboBox : 103,
removeFrontSymbol : 104,
removeFrontWord : 105,
unicodeToChar : 106,
showContextMenu : 107,
disableNumLock : 108,
disableScrollLock : 109,
addSJKSpace : 110,
bigMoveGraphicObjectLeft : 111,
littleMoveGraphicObjectLeft : 112,
bigMoveGraphicObjectRight : 113,
littleMoveGraphicObjectRight : 114,
bigMoveGraphicObjectDown : 115,
littleMoveGraphicObjectDown : 116,
bigMoveGraphicObjectUp : 117,
littleMoveGraphicObjectUp : 118,
moveToPreviousPage : 119,
selectToPreviousPage : 120,
moveToStartPreviousPage : 121,
selectToStartPreviousPage : 122,
moveToPreviousHeaderFooter : 123,
moveToPreviousHeader : 124,
moveToNextPage : 125,
selectToNextPage : 126,
moveToStartNextPage : 127,
selectToStartNextPage : 128,
moveToNextHeaderFooter : 129,
moveToNextHeader : 130,
disableBrowserZoomIn : 131
};

var c_oAscDocumentRefenceToType = {
Expand Down

0 comments on commit ba01cef

Please sign in to comment.