keyboard shortcut ctrl/cmd-shift-a for '@'

pull/3/merge
jmoenig 2014-07-11 09:21:14 +02:00
rodzic 7ac63a5ccd
commit 5185cead0b
2 zmienionych plików z 19 dodań i 13 usunięć

Wyświetl plik

@ -2187,3 +2187,7 @@ ______
* revert changes made for JSLints sake after the issue was fixed in JSLint
* Blocks: change “delete” behavior in context menus to only delete this particular blocks (and reconnect the next block to the previous one)
* fixed #490
140711
------
* Morphic: keyboard shortcut ctrl/cmd-shift-a for @

Wyświetl plik

@ -1035,7 +1035,7 @@
/*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio,
FileList, getBlurredShadowSupport*/
var morphicVersion = '2014-June-23';
var morphicVersion = '2014-July-11';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
@ -4495,9 +4495,9 @@ CursorMorph.prototype.processKeyPress = function (event) {
}
if (event.keyCode) { // Opera doesn't support charCode
if (event.ctrlKey) {
this.ctrl(event.keyCode);
this.ctrl(event.keyCode, event.shiftKey);
} else if (event.metaKey) {
this.cmd(event.keyCode);
this.cmd(event.keyCode, event.shiftKey);
} else {
this.insert(
String.fromCharCode(event.keyCode),
@ -4506,9 +4506,9 @@ CursorMorph.prototype.processKeyPress = function (event) {
}
} else if (event.charCode) { // all other browsers
if (event.ctrlKey) {
this.ctrl(event.charCode);
this.ctrl(event.charCode, event.shiftKey);
} else if (event.metaKey) {
this.cmd(event.keyCode);
this.cmd(event.keyCode, event.shiftKey);
} else {
this.insert(
String.fromCharCode(event.charCode),
@ -4525,13 +4525,13 @@ CursorMorph.prototype.processKeyDown = function (event) {
var shift = event.shiftKey;
this.keyDownEventUsed = false;
if (event.ctrlKey) {
this.ctrl(event.keyCode);
this.ctrl(event.keyCode, event.shiftKey);
// notify target's parent of key event
this.target.escalateEvent('reactToKeystroke', event);
return;
}
if (event.metaKey) {
this.cmd(event.keyCode);
this.cmd(event.keyCode, event.shiftKey);
// notify target's parent of key event
this.target.escalateEvent('reactToKeystroke', event);
return;
@ -4746,8 +4746,10 @@ CursorMorph.prototype.insert = function (aChar, shiftKey) {
}
};
CursorMorph.prototype.ctrl = function (aChar) {
if ((aChar === 97) || (aChar === 65)) {
CursorMorph.prototype.ctrl = function (aChar, shiftKey) {
if (aChar === 64 || (aChar === 65 && shiftKey)) {
this.insert('@');
} else if (aChar === 65) {
this.target.selectAll();
} else if (aChar === 90) {
this.undo();
@ -4759,8 +4761,6 @@ CursorMorph.prototype.ctrl = function (aChar) {
this.insert('[');
} else if (aChar === 93) {
this.insert(']');
} else if (aChar === 64) {
this.insert('@');
} else if (!isNil(this.target.receiver)) {
if (aChar === 68) {
this.target.doIt();
@ -4774,8 +4774,10 @@ CursorMorph.prototype.ctrl = function (aChar) {
};
CursorMorph.prototype.cmd = function (aChar) {
if (aChar === 65) {
CursorMorph.prototype.cmd = function (aChar, shiftKey) {
if (aChar === 64 || (aChar === 65 && shiftKey)) {
this.insert('@');
} else if (aChar === 65) {
this.target.selectAll();
} else if (aChar === 90) {
this.undo();