shortcuts for mac should use cmd instead of ctrl, closes #290

This commit is contained in:
azivner 2019-01-09 21:42:16 +01:00
parent 99e56a9c42
commit 3ff3021acd
3 changed files with 5 additions and 11 deletions

View file

@ -117,13 +117,6 @@ function exec(cmd) {
}
if (utils.isElectron() && utils.isMac()) {
utils.bindShortcut('ctrl+c', () => exec("copy"));
utils.bindShortcut('ctrl+v', () => exec('paste'));
utils.bindShortcut('ctrl+x', () => exec('cut'));
utils.bindShortcut('ctrl+a', () => exec('selectAll'));
utils.bindShortcut('ctrl+z', () => exec('undo'));
utils.bindShortcut('ctrl+y', () => exec('redo'));
utils.bindShortcut('meta+c', () => exec("copy"));
utils.bindShortcut('meta+v', () => exec('paste'));
utils.bindShortcut('meta+x', () => exec('cut'));

View file

@ -117,10 +117,6 @@ function registerEntrypoints() {
utils.bindShortcut('ctrl+f', openInPageSearch);
if (utils.isMac()) {
utils.bindShortcut('meta+f', openInPageSearch);
}
// FIXME: do we really need these at this point?
utils.bindShortcut("ctrl+shift+up", () => {
const node = treeService.getCurrentNode();

View file

@ -137,6 +137,11 @@ function randomString(len) {
function bindShortcut(keyboardShortcut, handler) {
if (isDesktop()) {
if (isMac()) {
// use CMD (meta) instead of CTRL for all shortcuts
keyboardShortcut = keyboardShortcut.replace("ctrl", "meta");
}
$(document).bind('keydown', keyboardShortcut, e => {
handler();