Skip to content

Commit

Permalink
some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 21, 2016
1 parent e5a7c29 commit 223db0c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -1 +1,2 @@
* text=auto
*.js text eol=lf
25 changes: 14 additions & 11 deletions browser.js
Expand Up @@ -192,20 +192,23 @@ document.addEventListener('DOMContentLoaded', () => {
// it's not possible to add multiple accelerators
// so need to do this the oldschool way
document.addEventListener('keydown', event => {
if (process.platform === 'darwin' && event.metaKey) {
const combineKey = process.platform === 'darwin' ? event.metaKey : event.ctrlKey;

const num = parseInt(event.key, 10);
if (!combineKey) {
return;
}

if (event.shiftKey && event.keyCode === 221 /* ] */ ) {
nextConversation();
}
if (event.key === ']') {
nextConversation();
}

if (event.key === '[') {
previousConversation();
}

if (event.shiftKey && event.keyCode === 219 /* [ */ ) {
previousConversation();
}
const num = parseInt(event.key, 10);

if (num >= 1 && num <= 9) {
jumpToConversation(num);
}
if (num >= 1 && num <= 9) {
jumpToConversation(num);
}
});
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -32,13 +32,13 @@
},
"dependencies": {
"electron-config": "^0.2.1",
"electron-context-menu": "^0.4.0",
"electron-context-menu": "^0.6.0",
"electron-debug": "^1.0.0",
"electron-dl": "^1.0.0"
},
"devDependencies": {
"electron-packager": "^7.0.0",
"electron": "^1.3.3",
"electron": "^1.4.0",
"electron-packager": "^8.0.0",
"xo": "*"
},
"xo": {
Expand Down
21 changes: 11 additions & 10 deletions readme.md
Expand Up @@ -22,7 +22,7 @@ You can toggle dark mode in the `Caprine` menu or with <kbd>Cmd</kbd> <kbd>D</kb

### Jump to conversation hotkey

You can switch conversations similar to how you switch browser tabs: <kbd>Cmd</kbd> <kbd>n</kbd> (where `n` is `1` through `9`).
You can switch conversations similar to how you switch browser tabs: <kbd>Cmd/Ctrl</kbd> <kbd>n</kbd> (where `n` is `1` through `9`).


### Compact mode
Expand All @@ -42,15 +42,16 @@ Desktop notifications can be turned on in Preferences.

Description | Keys
--------------------- | -----------------------
New conversation | <kbd>Cmd</kbd> <kbd>n</kbd>
Search conversations | <kbd>Cmd</kbd> <kbd>f</kbd>
Toggle Dark mode | <kbd>Cmd</kbd> <kbd>d</kbd>
Jump to conversation | <kbd>Cmd</kbd> <kbd>1</kbd> through <kbd>9</kbd>
Mute conversation | <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>m</kbd>
Archive conversation | <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>a</kbd>
Delete conversation | <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>d</kbd>
Previous conversation | <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>[</kbd>
Next conversation | <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>]</kbd>
New conversation | <kbd>Cmd/Ctrl</kbd> <kbd>n</kbd>
Search conversations | <kbd>Cmd/Ctrl</kbd> <kbd>f</kbd>
Toggle Dark mode | <kbd>Cmd/Ctrl</kbd> <kbd>d</kbd>
Next conversation | <kbd>Cmd/Ctrl</kbd> <kbd>]</kbd> or <kbd>Ctrl</kbd> <kbd>Tab</kbd>
Previous conversation | <kbd>Cmd/Ctrl</kbd> <kbd>[</kbd> or <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>Tab</kbd>
Jump to conversation | <kbd>Cmd/Ctrl</kbd> <kbd>1</kbd>…<kbd>9</kbd>
Mute conversation | <kbd>Cmd/Ctrl</kbd> <kbd>Shift</kbd> <kbd>m</kbd>
Archive conversation | <kbd>Cmd/Ctrl</kbd> <kbd>Shift</kbd> <kbd>a</kbd>
Delete conversation | <kbd>Cmd/Ctrl</kbd> <kbd>Shift</kbd> <kbd>d</kbd>


## Install

Expand Down

0 comments on commit 223db0c

Please sign in to comment.