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
17
README.md
17
README.md
@ -118,14 +118,15 @@ 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 |
|
||||
| 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,
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user