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

Implement keyboard actions to avoid beeps on certain key bindings #2617

nathansobo opened this issue Aug 27, 2015 · 17 comments

Implement keyboard actions to avoid beeps on certain key bindings #2617

nathansobo opened this issue Aug 27, 2015 · 17 comments


Copy link

@nathansobo nathansobo commented Aug 27, 2015

When ctrl-cmd-down, ctrl-cmd-left, or ctrl-cmd-right are pressed in any Electron (or Chrome) input or textarea, an audible beep occurs. I believe I've tracked this down to the following methods not being implemented in in the NSResponder Action Messages section starting at line 351.

  • - (void)makeBaseWritingDirectionNatural:(id)sender
  • - (void)makeBaseWritingDirectionRightToLeft:(id)sender
  • - (void)makeBaseWritingDirectionLeftToRight:(id)sender

They do delegate up the responder chain in their implementation of doCommandBySelector on line 579. This leaves me unsure if there's any way to implement these methods via the content API or whether we'll need to add a patch. Either way, it would be great to implement them to avoid the beeping sound when moving lines down in Atom.

Refs atom/atom atom/atom#1669

/cc @zcbenz

Copy link

@zcbenz zcbenz commented Aug 28, 2015

Awesome, I'll see if we can implement those methods in Electron, and if it doesn't work we can always patch libchromiumcontent.

zcbenz added a commit to electron/libchromiumcontent that referenced this issue Sep 30, 2015
1. Avoid capturing key event to menu.

2. Enable accepting first mouse event.

3. Enable using transparent window.

4. Enable turning off auto hide cursor.

5. Disable beeps when pressing certain keys.
Copy link

@zcbenz zcbenz commented Sep 30, 2015

Hmm I have overridden those methods in Chromium and I'm sure they are on the right place since other methods like copy: and paste: are also there, but the beep is still there.

I also tested whether ctrl-cmd-alt-down would cause beep in Atom, and it does. The ctrl-cmd-alt-down maps to makeTextWritingDirectionNatural: and it is implemented in Chromium, so the problem is not we didn't implement the makeBaseWritingDirectionNatural: method, but something else.

I looked into the key handling code of Chromium and tried to comment out different parts of code, however the beep is always there, I'm out of ideas now.

Copy link

@nathansobo nathansobo commented Sep 30, 2015

That is frustrating. Thanks for trying. I wonder if we could dtrace into the API doing the beeping and figure out what is causing it. It drives me bonkers that this key binding has such a bad experience.

Copy link

@alexmalik alexmalik commented Jun 1, 2017


I would like to open dialogue on this issue again please. I'm open to trying to fix it myself with my limited knowledge but has anyone taken this any further by any chance?

Thanks for the efforts so far! 👍

Copy link

@hedefalk hedefalk commented Jul 5, 2017

@alexmalik I'm cheering you on from afar! Pretty please, I'd love a fix.

The workaround mentioned on the atom issue here:
atom/atom#1669 (comment)

does not work on my 10.12.5.

Copy link

@klvs klvs commented Aug 15, 2017

@hedefalk That workaround didn't work for me on OSX 10.12.5 either but I did learn that you can disable those sounds globally in system prefs -> sound which is fine by me though I'm sure someone wants it.

Copy link

@patrick-levesque patrick-levesque commented Aug 25, 2017

It was really bugging me too and I found a fix...
Just create a shortcut for ctrl-cmd-down in Keyboard/Shortcuts and disable it afterward.
No more whump sound for me in Atom! 😎
On macOS Sierra 10.12.6 with Atom 1.19.3.


Copy link

@karlhorky karlhorky commented Aug 25, 2017

@paralel-github tried it, but didn't help. Tried restarting Atom to make sure. Sound is still there though.

Copy link

@patrick-levesque patrick-levesque commented Aug 25, 2017

@karlhorky You're right... when I quit Atom, it doesn't work anymore. 😳

But I've figured out why it did work for me and here's the sequence you need to do. Will require to repeat steps each time you restart Atom. This is not the perfect fix but it works as long as you don't quit Atom.

  1. Quit Atom

  2. Open Keyboard/Shortcuts

  3. Enable the shortcut you've assigned crtl-cmd-down

  4. Quit Keyboard/Shortcuts

  5. Open Atom

  6. Open Keyboard/Shortcuts again

  7. Disable the shortcut

  8. Quit Keyboard/Shortcuts

Then it works!

Copy link

@karlhorky karlhorky commented Aug 25, 2017

Heh, yep, like that it works! Good find 😄

Copy link

@mikedpad mikedpad commented Sep 10, 2017

@paralel-github Thanks for that temporary solution. My sanity thanks you! 😄

Copy link

@jstr jstr commented Apr 12, 2018

For anyone still frustrated by this I've found the fix described here: atom/atom#1669 (comment) does work but requires a restart to take effect.

Copy link

@codebytere codebytere commented Sep 23, 2018

Given that this is likely a problem upstream in Chromium, and that this isn't currently on our roadmap, i'm going to go ahead and label this a wontfix. However, should someone determine a workable solution we would be very open to accepting a PR!

Copy link

@hanguokai hanguokai commented Jan 8, 2019

I reported this issue to Chromium on Dec 19, 2018 , and they confirmed it now. To vote up and follow it, Star this issue.

Copy link

@sentience sentience commented Jan 7, 2020

Here's a work-around, which I've also posted to @hanguokai's Chromium issue (#2617 (comment)):

You can establish system-global key bindings for the key combinations ^⌘←, ^⌘↓, and ^⌘→ that are mapped to no operation ("noop"). Simply having these declared as valid keystrokes at the OS level eliminates the system beep that occurs even when a Chromium app accepts and handles the keystroke.

In order to establish this, you need to create a ~/Library/KeyBindings/DefaultKeyBinding.dict – note that you'll probably need to create the directory as well, and that the directory name is plural (Bindings), but the file name is singular (Binding). This should be in your user Library folder, not the /Library folder or the /System/Library folder.

The file should be a text file with these contents:

  "^@\UF701" = "noop";
  "^@\UF702" = "noop";
  "^@\UF703" = "noop";

^ means Ctrl, @ means Command, and \UF701, \UF702, and \UF703 are the codes for the three arrow keys. There's a nice reference Gist for this file's syntax here: I have attached a copy of my file in case that's easier for folks.

Once you have created this file, restart any applications where you want to use these keystrokes (or just reboot your system), and you should find that the system beeps are gone. I have successfully applied this tweak on macOS Catalina (10.15.2) to use the default keyboard shortcuts for the “View: Move Editor into Next Group” and “View: Move Editor into Previous Group” commands without hearing system beeps each time.

Copy link

@Stakker Stakker commented Feb 5, 2020

Ahh thank you for the fix. This was driving me crazy :-)

Copy link

@cpkenn09y cpkenn09y commented Aug 21, 2020

same the error sounds were so annoying. Thanks for the fix @sentience!

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

No branches or pull requests