1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-01-21 20:52:11 +01:00

add 'open-in-browser' key shortcut

This commit is contained in:
rhysd 2017-04-20 14:47:48 +09:00
parent dad67cd8d4
commit 241b97f0b4
2 changed files with 14 additions and 8 deletions

View File

@ -119,13 +119,14 @@ to know what you're doing.
Object whose key is a key sequence and whose value is an action name.
| Action Name | Description | Default Key |
|-----------------|---------------------------------|-------------|
|-------------------|---------------------------------|-------------|
| `scroll-down` | Scroll down window | `j` |
| `scroll-up` | Scroll up window | `k` |
| `scroll-top` | Scroll up to top of window | `i` |
| `scroll-bottom` | Scroll down to bottom of window | `m` |
| `next-account` | Switch to next account | N/A |
| `prev-account` | Switch to previous account | N/A |
| `open-in-browser` | Open current page in browser | N/A |
If an action name starts with `/`, it will navigate to the path. For example,
if you set `"/web/timelines/home"` to some key shortcut and you input the key,

View File

@ -3,6 +3,8 @@ import * as Mousetrap from 'mousetrap';
import * as Ipc from './ipc';
import log from './log';
import {Config, Account} from '../main/config';
import r from './require';
const shell = r('electron').remote.shell;
function scrollable() {
const scrollable = document.querySelector('.scrollable');
@ -49,6 +51,9 @@ const ShortcutActions = {
'prev-account': () => {
Ipc.send('mstdn:prev-account');
},
'open-in-browser': () => {
shell.openExternal(window.location.href);
}
} as {[action: string]: () => void};
export default function setupKeymaps(