mirror of
https://github.com/zadam/trilium.git
synced 2025-01-17 20:48:12 +08:00
shortcuts for mac should use cmd instead of ctrl, closes #290
This commit is contained in:
parent
99e56a9c42
commit
3ff3021acd
3 changed files with 5 additions and 11 deletions
|
@ -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'));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue