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

Global shortcut unregisters/disables default actions #1338

Closed
jesperbjerke opened this issue Mar 31, 2015 · 16 comments
Closed

Global shortcut unregisters/disables default actions #1338

jesperbjerke opened this issue Mar 31, 2015 · 16 comments

Comments

@jesperbjerke
Copy link

Not sure if this is the intended outcome, but wasnt what I expected;
if I register 'ctrl+c' or 'ctrl+x' as a global shortcut, the system will only listen to that function and not run the default copy/cut-function. I was hoping to bind my listener as an addition to the default function..

@zcbenz
Copy link
Member

zcbenz commented Apr 1, 2015

This behavior is intended, it sounds good to add a way to invoke default actions though.

@jesperbjerke
Copy link
Author

Any chance for this to be implemented in the near future?

@tyson-benson
Copy link

+1, I want a way to register a global keyboard shortcut without intercepting and preventing the default behaviour. Same example as above, (Ctrl+C).

@RealOrangeOne
Copy link

👍 Definately a necessary feature, preferably without writing things natively, defeating the 'cross-platform'-ness

@MadLittleMods
Copy link

👍 I have a similar issue on the NW.js repo: nwjs/nw.js#3503

@zcbenz
Copy link
Member

zcbenz commented May 6, 2016

I have to say this is a very useful feature, but it is impossible with the APIs provided by system, it is by design that registering a global shortcut would disable the default actions.

The only possible way to achieve this is to set global keyboard hooks, which on some platforms would make the app behave like virus, and for others it would require root privilege to run. And it is better to write a node module for this instead of make it a built-in feature of Electron.

So I'm closing this as won't fix.

@aAmitSengar
Copy link

aAmitSengar commented Sep 9, 2016

hey every one i'm new here and i'm just trying to register globalShortcut like

globalShortcut.register('ctrl+F5', function() {
        console.log('ctrl+F5 pressed');
    });

But ctrl+F5 is not working in other applications like Firefox :(
i just want to disable Development Tools and want to stop refreshing the page .
Please suggest me what should i do?

Thanks in advance

@RealOrangeOne
Copy link

@aAmitSengar Global shortcuts in electron block any other application from listening to that keyboard shortcut. That's what this issue is about. There is currently no fix for this

@Nantris
Copy link
Contributor

Nantris commented Jul 22, 2018

@zcbenz is there any chance that two years later this might be reconsidered? It would enable a LOT of use cases I think.

@akshayhashedIn
Copy link

@slapbox This might help.
Recent discussions

@Nantris
Copy link
Contributor

Nantris commented Jul 23, 2018

Thanks @akshayhashedIn!

@nonoroazoro
Copy link

Why this issue is closed while there's no available solution?

@qssns
Copy link

qssns commented May 14, 2022

still having this issue, is the solution here yet?

@1739616529
Copy link

啥时候能有对应的api啊

@Nantris
Copy link
Contributor

Nantris commented May 21, 2022

@T31K
Copy link

T31K commented Nov 1, 2022

Figured out a work around:
#36204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests