mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
shortcuts for mac should use cmd instead of ctrl, closes #290
This commit is contained in:
parent
99e56a9c42
commit
3ff3021acd
@ -117,13 +117,6 @@ function exec(cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (utils.isElectron() && utils.isMac()) {
|
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+c', () => exec("copy"));
|
||||||
utils.bindShortcut('meta+v', () => exec('paste'));
|
utils.bindShortcut('meta+v', () => exec('paste'));
|
||||||
utils.bindShortcut('meta+x', () => exec('cut'));
|
utils.bindShortcut('meta+x', () => exec('cut'));
|
||||||
|
@ -117,10 +117,6 @@ function registerEntrypoints() {
|
|||||||
|
|
||||||
utils.bindShortcut('ctrl+f', openInPageSearch);
|
utils.bindShortcut('ctrl+f', openInPageSearch);
|
||||||
|
|
||||||
if (utils.isMac()) {
|
|
||||||
utils.bindShortcut('meta+f', openInPageSearch);
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: do we really need these at this point?
|
// FIXME: do we really need these at this point?
|
||||||
utils.bindShortcut("ctrl+shift+up", () => {
|
utils.bindShortcut("ctrl+shift+up", () => {
|
||||||
const node = treeService.getCurrentNode();
|
const node = treeService.getCurrentNode();
|
||||||
|
@ -137,6 +137,11 @@ function randomString(len) {
|
|||||||
|
|
||||||
function bindShortcut(keyboardShortcut, handler) {
|
function bindShortcut(keyboardShortcut, handler) {
|
||||||
if (isDesktop()) {
|
if (isDesktop()) {
|
||||||
|
if (isMac()) {
|
||||||
|
// use CMD (meta) instead of CTRL for all shortcuts
|
||||||
|
keyboardShortcut = keyboardShortcut.replace("ctrl", "meta");
|
||||||
|
}
|
||||||
|
|
||||||
$(document).bind('keydown', keyboardShortcut, e => {
|
$(document).bind('keydown', keyboardShortcut, e => {
|
||||||
handler();
|
handler();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user