diff --git a/dist/leaflet.distortableimage.js b/dist/leaflet.distortableimage.js index 61a93e7f8..0df597842 100644 --- a/dist/leaflet.distortableimage.js +++ b/dist/leaflet.distortableimage.js @@ -1228,20 +1228,17 @@ L.DistortableImage.Edit = L.Handler.extend({ opacity: 0.7, outline: "1px solid red", keymap: { - 8: "_removeOverlay", // backspace windows / delete mac - 46: "_removeOverlay", // delete windows / delete + fn mac - 20: "_toggleRotate", // CAPS - 27: "_deselect", // esc - 68: "_toggleRotateDistort", // d - 69: "_toggleIsolate", // e - 73: "_toggleIsolate", // i - 74: "_sendUp", // j - 75: "_sendDown", // k - 76: "_toggleLock", // l - 79: "_toggleOutline", // o - 82: "_toggleRotateDistort", // r - 83: "_toggleScale", // s - 84: "_toggleTransparency" // t + 'CapsLock': '_toggleRotate', + 'Escape': '_deselect', + 'd': '_toggleRotateDistort', + 'i': '_toggleIsolate', + 'j': '_sendUp', + 'k': '_sendDown', + 'l': '_toggleLock', + 'o': '_toggleOutline', + 'r': '_toggleRotateDistort', + 's': '_toggleScale', + 't': '_toggleTransparency', } }, @@ -1441,7 +1438,7 @@ L.DistortableImage.Edit = L.Handler.extend({ _onKeyDown: function(event) { var keymap = this.options.keymap, - handlerName = keymap[event.which]; + handlerName = keymap[event.key]; if (handlerName !== undefined && this._overlay.options.suppressToolbar !== true) { this[handlerName].call(this); diff --git a/src/edit/DistortableImage.Edit.js b/src/edit/DistortableImage.Edit.js index 5258a65b0..069171184 100644 --- a/src/edit/DistortableImage.Edit.js +++ b/src/edit/DistortableImage.Edit.js @@ -5,20 +5,17 @@ L.DistortableImage.Edit = L.Handler.extend({ opacity: 0.7, outline: "1px solid red", keymap: { - 8: "_removeOverlay", // backspace windows / delete mac - 46: "_removeOverlay", // delete windows / delete + fn mac - 20: "_toggleRotate", // CAPS - 27: "_deselect", // esc - 68: "_toggleRotateDistort", // d - 69: "_toggleIsolate", // e - 73: "_toggleIsolate", // i - 74: "_sendUp", // j - 75: "_sendDown", // k - 76: "_toggleLock", // l - 79: "_toggleOutline", // o - 82: "_toggleRotateDistort", // r - 83: "_toggleScale", // s - 84: "_toggleTransparency" // t + 'CapsLock': '_toggleRotate', + 'Escape': '_deselect', + 'd': '_toggleRotateDistort', + 'i': '_toggleIsolate', + 'j': '_sendUp', + 'k': '_sendDown', + 'l': '_toggleLock', + 'o': '_toggleOutline', + 'r': '_toggleRotateDistort', + 's': '_toggleScale', + 't': '_toggleTransparency', } }, @@ -218,7 +215,7 @@ L.DistortableImage.Edit = L.Handler.extend({ _onKeyDown: function(event) { var keymap = this.options.keymap, - handlerName = keymap[event.which]; + handlerName = keymap[event.key]; if (handlerName !== undefined && this._overlay.options.suppressToolbar !== true) { this[handlerName].call(this);