Skip to content

Add shortcuts inside webview to move back/forward - #533

Merged
gdelavald merged 7 commits into
RocketChat:developfrom
vcapretz:develop
Sep 13, 2017
Merged

Add shortcuts inside webview to move back/forward#533
gdelavald merged 7 commits into
RocketChat:developfrom
vcapretz:develop

Conversation

@vcapretz

@vcapretz vcapretz commented Sep 7, 2017

Copy link
Copy Markdown
Contributor

@RocketChat/DesktopApp

Closes #197

Mousetrap is a package to help we configure shortcuts, now when you are inside a channel and type Ctrl (or Cmd) + Left/Right it acts just like the browser, so you can switch between channels.

it should get ctrl or cmd keys to go back and forward on history
inside the channels
@CLAassistant

CLAassistant commented Sep 7, 2017

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread src/scripts/webview.js Outdated
`);
});

Mousetrap.bind(['command+left', 'ctrl+left'], () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you should use "mod+left" instead for cross platform, rather than binding both.

Comment thread src/scripts/webview.js Outdated
Mousetrap.bind(['command+left', 'ctrl+left'], () => {
const webviewObj = this.getActive();
webviewObj.executeJavaScript(`
window.history.back();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the built in electron method not work here?

vcapretz and others added 2 commits September 9, 2017 19:08
we are now using menu items and accelerators for binding shortcuts

the shortcuts on windows and linux should be "alt+left/right" and
on mac "cmd+left/right", like on chrome for instance
@gdelavald
gdelavald merged commit 51603d2 into RocketChat:develop Sep 13, 2017
gdelavald pushed a commit that referenced this pull request Oct 27, 2017
* first attempt

* Adds mousetrap as a dependency

it should get ctrl or cmd keys to go back and forward on history
inside the channels

* Fix multiple spaceslint error

* Removes mousetrap dependency

we are now using menu items and accelerators for binding shortcuts

the shortcuts on windows and linux should be "alt+left/right" and
on mac "cmd+left/right", like on chrome for instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle backwards / forwards keyboard shortcuts

5 participants