Skip to content

Commit

Permalink
comment explaining scope in keyboard actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Sep 11, 2023
1 parent 5b85713 commit 9413cd2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/services/keyboard_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ const utils = require('./utils');
const isMac = process.platform === "darwin";
const isElectron = utils.isElectron();

/**
* Scope here means on which element the keyboard shortcuts are attached - this means that for the shortcut to work,
* the focus has to be inside the element.
*
* So e.g. shortcuts with "note-tree" scope work only when the focus is in note tree.
* This allows to have the same shortcut have different actions attached based on the context
* e.g. CTRL-C in note tree does something a bit different from CTRL-C in the text editor.
*/

const DEFAULT_KEYBOARD_ACTIONS = [
{
separator: "Note navigation"
Expand Down

0 comments on commit 9413cd2

Please sign in to comment.