Commit 7156771d authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Правка бага http://bugzserver/show_bug.cgi?id=24021

На mac не обрабатывался metaKey в эвенте.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55895 954022d7-b5bf-4e40-9824-e11837661b57
parent f48d9b27
......@@ -4908,7 +4908,7 @@ function DrawingObjects() {
_this.graphicObjectKeyPress = function(e) {
e.KeyCode = e.keyCode;
e.CtrlKey = e.ctrlKey;
e.CtrlKey = e.metaKey || e.ctrlKey;
e.AltKey = e.altKey;
e.ShiftKey = e.shiftKey;
e.Which = e.which;
......
......@@ -2746,6 +2746,8 @@ DrawingObjectsController.prototype =
onKeyDown: function(e)
{
// TODO!!! var ctrlKey = e.metaKey || e.ctrlKey
var drawingObjectsController = this;
var bRetValue = false;
var state = drawingObjectsController.curState;
......
......@@ -1638,9 +1638,10 @@
// Event handlers
/** @param event {jQuery.Event} */
/** @param event {KeyboardEvent} */
CellEditor.prototype._onWindowKeyDown = function (event) {
var t = this, kind = undefined, hieroglyph = false;
var ctrlKey = event.metaKey || event.ctrlKey;
if (!t.isOpened || !t.enableKeyEvents) {return true;}
......@@ -1688,27 +1689,27 @@
case 8: // "backspace"
if (hieroglyph) {t._syncEditors();}
t._removeChars(event.ctrlKey ? kPrevWord : kPrevChar);
t._removeChars(ctrlKey ? kPrevWord : kPrevChar);
return false;
case 46: // "del"
if (!t.hasFocus) {t.setFocus(true);}
if (hieroglyph) {t._syncEditors();}
t.skipTLUpdate = true;
t._removeChars(event.ctrlKey ? kNextWord : kNextChar);
t._removeChars(ctrlKey ? kNextWord : kNextChar);
return true;
case 37: // "left"
if (!t.hasFocus) {break;}
if (hieroglyph) {t._syncEditors();}
kind = event.ctrlKey ? kPrevWord : kPrevChar;
kind = ctrlKey ? kPrevWord : kPrevChar;
event.shiftKey ? t._selectChars(kind) : t._moveCursor(kind);
return false;
case 39: // "right"
if (!t.hasFocus) {break;}
if (hieroglyph) {t._syncEditors();}
kind = event.ctrlKey ? kNextWord : kNextChar;
kind = ctrlKey ? kNextWord : kNextChar;
event.shiftKey ? t._selectChars(kind) : t._moveCursor(kind);
return false;
......@@ -1727,19 +1728,19 @@
case 35: // "end"
if (!t.hasFocus) {break;}
if (hieroglyph) {t._syncEditors();}
kind = event.ctrlKey ? kEndOfText : kEndOfLine;
kind = ctrlKey ? kEndOfText : kEndOfLine;
event.shiftKey ? t._selectChars(kind) : t._moveCursor(kind);
return false;
case 36: // "home"
if (!t.hasFocus) {break;}
if (hieroglyph) {t._syncEditors();}
kind = event.ctrlKey ? kBeginOfText : kBeginOfLine;
kind = ctrlKey ? kBeginOfText : kBeginOfLine;
event.shiftKey ? t._selectChars(kind) : t._moveCursor(kind);
return false;
case 53: // 5
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// Отключим стандартную обработку браузера нажатия ctlr + 5
event.stopPropagation();
......@@ -1751,7 +1752,7 @@
break;
case 65: // A
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// Отключим стандартную обработку браузера нажатия ctlr + a
if (!t.isTopLineActive) {
......@@ -1765,7 +1766,7 @@
break;
case 66: // B
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// Отключим стандартную обработку браузера нажатия ctlr + b
event.stopPropagation();
......@@ -1777,7 +1778,7 @@
break;
case 73: // I
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// Отключим стандартную обработку браузера нажатия ctlr + i
event.stopPropagation();
......@@ -1789,7 +1790,7 @@
break;
/*case 83: // S
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
if (hieroglyph) {t._syncEditors();}
......@@ -1800,7 +1801,7 @@
break;*/
case 85: // U
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// Отключим стандартную обработку браузера нажатия ctlr + u
event.stopPropagation();
......@@ -1820,7 +1821,7 @@
return false;
case 80: // print Ctrl + p
if (event.ctrlKey) {
if (ctrlKey) {
event.stopPropagation();
event.preventDefault();
return false;
......@@ -1830,7 +1831,7 @@
case 67: // copy Ctrl + c
case 86: // paste Ctrl + v
case 88: // redo Ctrl + x
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
// возвращение фокуса в top line
if (t.isTopLineActive) {
......@@ -1850,7 +1851,7 @@
case 89: // ctrl + y
case 90: // ctrl + z
if (event.ctrlKey) {
if (ctrlKey) {
if (!t.hasFocus) {t.setFocus(true);}
event.which === 90 ? t.undo() : t.redo();
return false;
......@@ -1871,13 +1872,14 @@
return true;
};
/** @param event {jQuery.Event} */
/** @param event {KeyboardEvent} */
CellEditor.prototype._onWindowKeyPress = function (event) {
var t = this;
var ctrlKey = event.metaKey || event.ctrlKey;
if (!t.isOpened || !t.enableKeyEvents) {return true;}
if (t.skipKeyPress || event.which < 32 || event.altKey || event.ctrlKey) {
if (t.skipKeyPress || event.which < 32 || event.altKey || ctrlKey) {
t.skipKeyPress = true;
return true;
}
......@@ -1915,7 +1917,7 @@
return t.isTopLineActive ? true : false; // prevent event bubbling
};
/** @param event {jQuery.Event} */
/** @param event {KeyboardEvent} */
CellEditor.prototype._onWindowKeyUp = function (event) {
var t = this;
......@@ -1925,20 +1927,20 @@
}
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onWindowMouseUp = function (event) {
this.isSelectMode = false;
if (this.callTopLineMouseup) {this._topLineMouseUp();}
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onWindowMouseMove = function (event) {
if (this.isSelectMode && !this.hasCursor) {this._changeSelection(this._getCoordinates(event));}
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseDown = function (event) {
var t = this;
var coord = t._getCoordinates(event);
......@@ -1962,13 +1964,13 @@
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseUp = function (event) {
this.isSelectMode = false;
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseMove = function (event) {
this.hasCursor = true;
if (this.isSelectMode) {
......@@ -1977,13 +1979,13 @@
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseLeave = function (event) {
this.hasCursor = false;
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._onMouseDblClick = function (event) {
var t = this;
// Окончание слова
......@@ -2014,7 +2016,7 @@
return true;
};
/** @param event {jQuery.Event} */
/** @param event {MouseEvent} */
CellEditor.prototype._getCoordinates = function (event) {
var t = this;
var offs = $(t.canvasOverlay).offset();
......
......@@ -246,7 +246,7 @@ DrawingObjectsController.prototype.checkSelectedObjectsAndFireCallback = functio
DrawingObjectsController.prototype.onMouseDown = function(e, x, y)
{
e.ShiftKey = e.shiftKey;
e.CtrlKey = e.ctrlKey;
e.CtrlKey = e.metaKey || e.ctrlKey;
return this.curState.onMouseDown(e, x, y, 0);
};
......@@ -256,7 +256,7 @@ DrawingObjectsController.prototype.OnMouseDown = DrawingObjectsController.protot
DrawingObjectsController.prototype.onMouseMove = function(e, x, y)
{
e.ShiftKey = e.shiftKey;
e.CtrlKey = e.ctrlKey;
e.CtrlKey = e.metaKey || e.ctrlKey;
this.curState.onMouseMove(e, x, y, 0);
};
DrawingObjectsController.prototype.OnMouseMove = DrawingObjectsController.prototype.onMouseMove;
......@@ -265,7 +265,7 @@ DrawingObjectsController.prototype.OnMouseMove = DrawingObjectsController.protot
DrawingObjectsController.prototype.onMouseUp = function(e, x, y)
{
e.ShiftKey = e.shiftKey;
e.CtrlKey = e.ctrlKey;
e.CtrlKey = e.metaKey || e.ctrlKey;
this.curState.onMouseUp(e, x, y, 0);
};
DrawingObjectsController.prototype.OnMouseUp = DrawingObjectsController.prototype.onMouseUp;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment