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

Feature Request: Global keyboard shortcuts #15

Closed
2xAA opened this Issue Jan 20, 2016 · 11 comments

Comments

Projects
None yet
7 participants
@2xAA
Copy link

commented Jan 20, 2016

Would it be possible to create a config (or JavaScript) file to bind some keypresses to JavaScript console injections?

For example, music players could bind the media keys to JavaScript commands to start, stop and skip.

@zweicoder

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2016

@2xAA Which website are you looking at specifically? This might be possible but you would probably have to define your own functions and specify what DOM elements to click.

@2xAA

This comment has been minimized.

Copy link
Author

commented Jan 20, 2016

@zweicoder Specifically Google Play Music. The ability to bind a system's media keys to control that would be great!
I think it would be useful for other apps too, but I can't think of any off the top of my head.

(there is a project which wraps GPM as a desktop app called Radiant Player, but Flash is required to play back the music as they're using an OS X WebView, whereas nativefier uses Chromuim so GPM doesn't require flash)

@vexhack

This comment has been minimized.

Copy link

commented Jan 21, 2016

I second this. Would be wonderful.

Some answers might be here: https://github.com/twolfson/google-music-electron

@2xAA

This comment has been minimized.

Copy link
Author

commented Jan 23, 2016

@Gusbenz Woah, hadn't seen that before - thanks!

@rnarian

This comment has been minimized.

Copy link

commented Jan 26, 2016

👍

Another website would be soundcloud.com

@zweicoder

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2016

For anyone still wondering, it's possible to do this with the most naive methods being programmatic macros loaded in preload.js and hooked to key listeners like doc.onkeydown.

You can see here for an example of how I'm using it to add various hotkeys and extra logic for WhatsApp.

@2xAA

This comment has been minimized.

Copy link
Author

commented Jan 28, 2016

@zweicoder I'm assuming that doesn't bind the keypresses to system listeners, such as media keys right?

@zweicoder

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2016

@2xAA Nope, but I assumed you can find out the keycode for the media keys. Honestly not sure though

@axe312ger

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2018

Hey @jiahaog should we reopen this one to track the progress of my PR @ #698 ? :)

@ronjouch ronjouch reopened this Oct 22, 2018

@ronjouch ronjouch changed the title Feature Request: Config file for keypress actions Feature Request: Global keyboard shortcuts Oct 22, 2018

@axe312ger

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2018

Yay thanks @ronjouch :)

axe312ger added a commit to axe312ger/nativefier that referenced this issue Nov 4, 2018

@ronjouch ronjouch closed this in #698 Nov 5, 2018

ronjouch added a commit that referenced this issue Nov 5, 2018

Support global shortcuts that trigger input events (PR #698, Fixes #15)
This adds a new flag, allowing the user to define global shortcuts that trigger input events within the main window.

That way, I could easily wrap SoundCloud and Deezer to create a native app which reacts on my keyboard media buttons.
@ronjouch

This comment has been minimized.

Copy link
Collaborator

commented Dec 1, 2018

Released in v7.6.9. Thanks @axe312ger !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.