Unbind CKEDITOR ALT+0 shortcut (Accessibility Instructions)
As explained in this previous article, I switched from a Linux workstation to a Macbook for work and re-done some parts of the keyboard mapping to match what I’ve been used to during the past decade on Windows/Linux. Please check out the article if you are looking into a PC flavored Mac keyboard mapping. It’s a light version explained of the heavy French keyboard-like mapping I’m currently using to replicate main Windows/Linux keyboard keys combinations on Mac.
Well, I’m using a webapp making use of CKEditor in my day to day work and CKEditor had the good idea to map their Accessibility Instructions pop up to the key combination ALT+0. I’m already using this key combination to make a @ symbol with my French mapped keyboard.
A problem you said?
It’s usually not on Windows/Linux because the right ALT key is not mapped to the same output as the left ALT key. Windows/Linux consider the right ALT key as a ALT-Gr output.
On Mac with a French (PC) keyboard mapping the story is different. Left and right ALT keys give the same output equivalent to the regular ALT key. Which means to make an @ symbol in CKEditor, you’ll need to press ALT+0 and this key combination will trigger the Accessibility Insctructions of CKEditor EVERYTIME— annoying right? And you can’t disable this keystroke if you don’t have access to the CKEditor configuration of the website.
I created a small JS script to overcome this problem and reset the function of the ALT+0 key combination on the fly.
You can use two different browser extensions to achieve that based on the browser you use:
- Greasemonkey for Firefox
- Tampermonkey for Chrome
Once the extension installed create a new script and copy-paste the following script:
or you can download the JS file directly.
After that you should be good and never have this issue again