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:
parent
dad67cd8d4
commit
241b97f0b4
@ -119,13 +119,14 @@ to know what you're doing.
|
|||||||
Object whose key is a key sequence and whose value is an action name.
|
Object whose key is a key sequence and whose value is an action name.
|
||||||
|
|
||||||
| Action Name | Description | Default Key |
|
| Action Name | Description | Default Key |
|
||||||
|-----------------|---------------------------------|-------------|
|
|-------------------|---------------------------------|-------------|
|
||||||
| `scroll-down` | Scroll down window | `j` |
|
| `scroll-down` | Scroll down window | `j` |
|
||||||
| `scroll-up` | Scroll up window | `k` |
|
| `scroll-up` | Scroll up window | `k` |
|
||||||
| `scroll-top` | Scroll up to top of window | `i` |
|
| `scroll-top` | Scroll up to top of window | `i` |
|
||||||
| `scroll-bottom` | Scroll down to bottom of window | `m` |
|
| `scroll-bottom` | Scroll down to bottom of window | `m` |
|
||||||
| `next-account` | Switch to next account | N/A |
|
| `next-account` | Switch to next account | N/A |
|
||||||
| `prev-account` | Switch to previous 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 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,
|
if you set `"/web/timelines/home"` to some key shortcut and you input the key,
|
||||||
|
@ -3,6 +3,8 @@ import * as Mousetrap from 'mousetrap';
|
|||||||
import * as Ipc from './ipc';
|
import * as Ipc from './ipc';
|
||||||
import log from './log';
|
import log from './log';
|
||||||
import {Config, Account} from '../main/config';
|
import {Config, Account} from '../main/config';
|
||||||
|
import r from './require';
|
||||||
|
const shell = r('electron').remote.shell;
|
||||||
|
|
||||||
function scrollable() {
|
function scrollable() {
|
||||||
const scrollable = document.querySelector('.scrollable');
|
const scrollable = document.querySelector('.scrollable');
|
||||||
@ -49,6 +51,9 @@ const ShortcutActions = {
|
|||||||
'prev-account': () => {
|
'prev-account': () => {
|
||||||
Ipc.send('mstdn:prev-account');
|
Ipc.send('mstdn:prev-account');
|
||||||
},
|
},
|
||||||
|
'open-in-browser': () => {
|
||||||
|
shell.openExternal(window.location.href);
|
||||||
|
}
|
||||||
} as {[action: string]: () => void};
|
} as {[action: string]: () => void};
|
||||||
|
|
||||||
export default function setupKeymaps(
|
export default function setupKeymaps(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user