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

registering "Capslock" as globalShortcut does not work on mac #21830

Closed
3 tasks done
jsphweid opened this issue Jan 19, 2020 · 2 comments
Closed
3 tasks done

registering "Capslock" as globalShortcut does not work on mac #21830

jsphweid opened this issue Jan 19, 2020 · 2 comments

Comments

@jsphweid
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    v5.0.13
    v6.1.7
    v7.1.9

  • Operating System:
    macOS 10.15.2

Expected Behavior

putting this in app.on("ready", () => should print out is registered true on boot up in the terminal and hello WRLD every time Capslock is pressed.

  globalShortcut.register("Capslock", () => {
    console.log('hello WRLD' )
  });

  console.log("is registered", globalShortcut.isRegistered("Capslock"));

Actual Behavior

is registered true prints out when it boots, but hello WRLD never prints out, i.e. the callback is never seemingly executed.

To Reproduce

  1. clone https://github.com/szwacz/electron-boilerplate
  2. npm install
  3. npm install -D electron@5 (or 6 or 7)
  4. add above code chunk to the app.on("ready", () =>
  5. npm start
  6. observe terminal and compare with "Actual Behavior" section above.

Additional Information

Other hotkeys DO work just fine.

I used to use Seil/Karabiner (programs that can manipulate the behavior ofcapslock) on this machine but both have been uninstalled.

Mac allows you to change Capslock in the System Preferences, experimenting with the Capslock behavior a bit. However, I've noticed that it doesn't seem to make a difference whether it's on the default or "No Action"

@erickzhao
Copy link
Member

erickzhao commented Jan 29, 2020

Just tested on 5.0.0-beta-3 (first version that #16719 landed) and can also reproduce this issue.

@electron-triage
Copy link

The Electron version reported on this issue is no longer supported. See our supported versions documentation.

If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.

Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
7.2.x
Unsorted Issues
Development

No branches or pull requests

3 participants