diff --git a/README.md b/README.md index 64e753d4..bf3b7fc4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ After installation use default shortcut `ctrl+space` to show an app window. You * Calculator; * Smart converter. `15$`, `150 рублей в евро`, `100 eur in gbp`; +## Shortcuts + +Cerebro provides several shortcuts to improve your productivity: + +* `ctrl+c`: copy the result from a plugin to the clipboard, if the plugin does not provida a result, the term you introduced will be copied +* `ctrl+1...9`: select directly a result from the list +* `ctrl+[hjkl]`: navigate through the results using vim-like keys (Also `ctrl+o` to select the result) + ### Install and manage custom plugins Use built-in `plugins` command to search and manage custom plugins. diff --git a/app/main/components/Cerebro/index.js b/app/main/components/Cerebro/index.js index 129629f5..2b466d10 100644 --- a/app/main/components/Cerebro/index.js +++ b/app/main/components/Cerebro/index.js @@ -179,7 +179,8 @@ class Cerebro extends Component { } } - if (event.metaKey || event.ctrlKey) { + // shortcuts for ctrl+... + if ((event.metaKey || event.ctrlKey) && !event.altKey) { if (event.keyCode === 67) { // Copy to clipboard on cmd+c const text = this.highlightedResult()?.clipboard || this.props.term @@ -198,7 +199,7 @@ class Cerebro extends Component { const number = Math.abs(49 - event.keyCode) const result = this.props.results[number] if (result) { - return this.selectItem(result) + return this.selectItem(result, event) } }