Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shortcuts inside webview to move back/forward #533

Merged
merged 7 commits into from
Sep 13, 2017

Conversation

vcapretz
Copy link
Contributor

@vcapretz vcapretz commented Sep 7, 2017

@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
Copy link

CLAassistant commented Sep 7, 2017

CLA assistant check
All committers have signed the CLA.

@@ -41,6 +42,24 @@ class WebView extends EventEmitter {
}, '*')
`);
});

Mousetrap.bind(['command+left', 'ctrl+left'], () => {
Copy link
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.

Mousetrap.bind(['command+left', 'ctrl+left'], () => {
const webviewObj = this.getActive();
webviewObj.executeJavaScript(`
window.history.back();
Copy link
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