You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement keyboard actions to avoid beeps on certain key bindings #2617
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 bridged_content_view.mm in the NSResponder Action Messages section starting at line 351.
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.
Reacted by Lenny Sirivong, Jack McDade, Antonio Stoilkov, Peter Lyons, Sinan Yasar, Jordan Weaver, Alex Malik, Jarek Radosz, Parker Bond, varkor and 8 more
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.
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.
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! 👍
Reacted by Karl Horky, Marten, Brandon Weiss, Louis Orleans, Viktor Hedefalk, Parker Bond and Tom Rogers
Reacted by Jeff Maher, Brandon Weiss and Tom Rogers
@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.
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.
@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.
Quit Atom
Open Keyboard/Shortcuts
Enable the shortcut you've assigned crtl-cmd-down
Quit Keyboard/Shortcuts
Open Atom
Open Keyboard/Shortcuts again
Disable the shortcut
Quit Keyboard/Shortcuts
Then it works!
Reacted by Karl Horky, Michael Daniel Padilla, Fille, David Klanac, Flávio Camilo, YoungTaek, Thomas Groutars, mkoorn, Stakker, Amit Dhamu and 2 more
Reacted by matt morris, YoungTaek, Hugo Melo, Thomas Groutars, mkoorn and Amit Dhamu
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:
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.
Reacted by Jarek Radosz, Cristian Díaz, Drew Lustro, Stakker, dominictobias, Germán Méndez Bravo, YuriyNovikov, Dorian Marchal, Nicolai Henriksen, basvk and 58 more
Reacted by YoungTaek, Germán Méndez Bravo, Nicolai Henriksen, Matthew McVickar, Roland Leth, Brian Woodward, Daniel L. Alves, Kevin Jung, Gabriel Fortuna, Kuray and 7 more
Reacted by Karl Horky, Cristian Díaz, Bruno Sanches, Jackie(Guokai) Han, YoungTaek, Germán Méndez Bravo, YuriyNovikov, Dorian Marchal, Andrew Straussman, Joshua Kleckner and 29 more
Reacted by Tomer Danan, Dominik Ferber, Elia Schito and Leonardo Rick
I tried the fix from #2617 (comment)
but it doesn't work on MacOS Ventura. The error sound is still there.
I hadn't applied the fix on my current machine, which is running macOS Ventura 13.1. I just applied the fix it and it worked as advertised. In your position, I would double-check the spelling of all the file/directory names, and ensure that if I had downloaded the DefaultKeyBinding.dict.zip file I had extracted it to DefaultKeyBinding.dict.
Finally, make sure restart any apps to allow the fix to take effect. In my case, I created the KeyBindings folder in /Users/kyank/Library, dropped the DefaultKeyBinding.dict.zip file into it, double-clicked it to extract the DefaultKeyBinding.dict file, and then deleted the ZIP. Once I had done that, I quit VS Code, then relaunched it after a few seconds. The beeps were gone.
It looks like the custom keysBindings no longer work in macOS 14.4. When moving a line up or down with control + command + upArrow / downArrow the annoying sound effect is back again.
Basically I needed to add the : at the end of noop and invert the order for the Ctrl + Option + Cmd + DownArrow
Reacted by Didier Brouwers, Roland Leth, Trey Piepmeier, John Kreitlow, Antonio P Lacerda, Omer Cohen, Nicolai Henriksen, Ruibin Choo, Edward Brey, Lucas H. Rinaldi and 11 more
Reacted by emredalka
Reacted by Lucas H. Rinaldi, Irakli Darbuashvili, damian-prom, Joynal Rab, Jason McKenzie, Trevor Lee, Tyler Burton, cvcore, toosla and Michael Tigas
Basically I needed to add the : at the end of noop and invert the order for the Ctrl + Option + Cmd + DownArrow
Victory! Today was the first time I was trying to implement the keybinding, so I'm grateful that I found this post so quickly. Also feeling fortunate that you guys use the same custom keyboard shortcuts for moving tabs as I do!
Reacted by Trevor Lee, Leonardo Rick, Darcy Darbyson, Patrick, Joachim Jablon, Dan Anderson and Michael Tigas
Activity
zcbenz commentedon 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.
Add patch to fix webview's NSView on Mac.
zcbenz commentedon 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:andpaste:are also there, but the beep is still there.I also tested whether
ctrl-cmd-alt-downwould cause beep in Atom, and it does. Thectrl-cmd-alt-downmaps tomakeTextWritingDirectionNatural:and it is implemented in Chromium, so the problem is not we didn't implement themakeBaseWritingDirectionNatural: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.
nathansobo commentedon 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.
alexmalik commentedon Jun 1, 2017
Hello,
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! 👍
hedefalk commentedon 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.
klvs commentedon 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.
patrick-levesque commentedon 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.
karlhorky commentedon Aug 25, 2017
@paralel-github tried it, but didn't help. Tried restarting Atom to make sure. Sound is still there though.
patrick-levesque commentedon 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.
Quit Atom
Open Keyboard/Shortcuts
Enable the shortcut you've assigned crtl-cmd-down
Quit Keyboard/Shortcuts
Open Atom
Open Keyboard/Shortcuts again
Disable the shortcut
Quit Keyboard/Shortcuts
Then it works!
karlhorky commentedon Aug 25, 2017
Heh, yep, like that it works! Good find 😄
mikedpad commentedon Sep 10, 2017
@paralel-github Thanks for that temporary solution. My sanity thanks you! 😄
8 remaining items
sentience commentedon 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:
^means Ctrl,@means Command, and\UF701,\UF702, and\UF703are the codes for the three arrow keys. There's a nice reference Gist for this file's syntax here: https://gist.github.com/trusktr/1e5e516df4e8032cbc3d I have attached a copy of my file in case that's easier for folks.DefaultKeyBinding.dict.zip
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.
Stakker commentedon Feb 5, 2020
Ahh thank you for the fix. This was driving me crazy :-)
cpkenn09y commentedon Aug 21, 2020
same the error sounds were so annoying. Thanks for the fix @sentience!
nornagon commentedon Jul 12, 2022
fwiw if you add the Arabic input mode in Keyboard > Input Sources, then remove it, the beeps also go away.
alivault commentedon Jan 21, 2023
I tried the fix from #2617 (comment)
but it doesn't work on MacOS Ventura. The error sound is still there.
Edit: I tried again and it worked. No restart needed.
sentience commentedon Jan 21, 2023
I hadn't applied the fix on my current machine, which is running macOS Ventura 13.1. I just applied the fix it and it worked as advertised. In your position, I would double-check the spelling of all the file/directory names, and ensure that if I had downloaded the DefaultKeyBinding.dict.zip file I had extracted it to DefaultKeyBinding.dict.
Finally, make sure restart any apps to allow the fix to take effect. In my case, I created the KeyBindings folder in /Users/kyank/Library, dropped the DefaultKeyBinding.dict.zip file into it, double-clicked it to extract the DefaultKeyBinding.dict file, and then deleted the ZIP. Once I had done that, I quit VS Code, then relaunched it after a few seconds. The beeps were gone.
LeonardoRick commentedon Jun 20, 2023
hey @sentience I'm struggling to make the sound stop when pressing
Ctrl + Option + Cmd + DownArrowI even tried to add on every arrow to see if this works and also change the order.
This is my file for now:
Am I doing something wrong? Any advice on that? I feel that's a silly detail that is holding me back
LeonardoRick commentedon Jul 11, 2023
Found the solution finally, just for reference, the right
noopforCtrl + Option + Cmd + DownArrowis:jrab commentedon Feb 2, 2024
@sentience thank you!! this worked perfectly (required a restart of vscode) -- was driving me up a wall
didierbrouwers commentedon Mar 11, 2024
It looks like the custom keysBindings no longer work in macOS 14.4. When moving a line up or down with control + command + upArrow / downArrow the annoying sound effect is back again.
LeonardoRick commentedon Mar 11, 2024
@didierbrouwers Don't know what happened with Sonoma 14.4 but I finally found a solution that is currently working for me:
Basically I needed to add the
:at the end ofnoopand invert the order for theCtrl + Option + Cmd + DownArrowdidierbrouwers commentedon Mar 11, 2024
@LeonardoRick yes, your solution stops the sound effect again! Thanks!
dannypernik commentedon Jun 8, 2024
Victory! Today was the first time I was trying to implement the keybinding, so I'm grateful that I found this post so quickly. Also feeling fortunate that you guys use the same custom keyboard shortcuts for moving tabs as I do!
cpbotha commentedon Sep 18, 2025
Confirmed to work on macOS 26 Tahoe as well, thank you so very much @LeonardoRick !
geon commentedon Apr 1, 2026
OMG, thanks so much! It's been driving me crazy.
Works for me in vscode on macos 15.6 (24G84)