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

Accelerator for "printscreen" key #4663

Closed
mradionov opened this issue Mar 3, 2016 · 8 comments
Closed

Accelerator for "printscreen" key #4663

mradionov opened this issue Mar 3, 2016 · 8 comments

Comments

@mradionov
Copy link

  • Electron version: 0.36.9
  • Operating system: Ubuntu 14.04

Currently it is not possible to bind global shortcut for print screen key.
I've found that it has a defined constant in:

https://github.com/atom/electron/blob/v0.36.9/atom/common/keyboard_util.cc#L94

but it's actually never used in a condition which identifies registered key:

https://github.com/atom/electron/blob/v0.36.9/atom/browser/ui/accelerator_util.cc#L62

Is there any reason "printscreen" key is not present in this check? Thanks.

@mradionov
Copy link
Author

Great, thank you!

@dmfarcas
Copy link

@mradionov @zcbenz , does this work for you now? It doesn't seem to work on KDE + ArchLinux.

    globalShortcut.register('PrintScreen', () => {
      console.log('Say cheese!');
    });

This doesn't work for example, but other keyboard shortcuts register fine. Is there a problem between the chair and the keyboard or is the issue still here?

Thanks,
Dan

@akolnati
Copy link

I have the same problem. PrintScreen doesn't work on Windows OS

@McPo
Copy link

McPo commented Oct 3, 2016

Its also doesn't appear to work on OSX either. Allow it might be worth clarifying that Im using the normal printscreen combination for OSX cmd+shift+3, and not a printscreen button on a keyboard.

Would be handy to have the printscreen key event launch when any valid combination is used. This may require reading the preferences on each system to determine the users chosen key combination. At the moment Command+Shift+3 works but the user could change it.

@MarshallOfSound
Copy link
Member

Allow it might be worth clarifying that Im using the normal printscreen combination for OSX cmd+shift+3, and not a printscreen button on a keyboard.

Yeah, that isn't the printscreen keycode. That's a combination of 3 different keycodes. You can listen for that accelerator by listening for Command+Shift+3. It wouldn't make sense for that to be considered "PrintScreen" as "PrintScreen" is actually it's own physical key.

@1001v
Copy link

1001v commented Oct 15, 2016

Still doesn't work on linux.

@arku31
Copy link

arku31 commented Nov 30, 2017

Still doesn't work. Guys, did you find any solution or dirty hacks?

@0length
Copy link

0length commented Jan 1, 2021

I have the same problem. PrintScreen doesn't work on Windows OS

me too.. it is happen when upgrade my electron version..

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

No branches or pull requests

9 participants