About the backtick on a French Mac keyboard
Recently a friend brought to my attention that the backtick ( ` ) is a dead key on the French Mac keyboard; that is to say that it does not generate a complete character, and that you need to type another key after having typed a backtick for it to show as a single character.
This is the normal behavior of a dead key (you can type accented characters with that), but it can be annoying if you code a lot in ECMAScript 6 and use template strings, like for instance :
var name = "tchap";
console.log(`Bonjour, ${name}!`);
... or if you have code blocks in Markdown, as well:
```javascript
var name = "tchap";
```
What then ?
Looks like there is no simple solution for changing this behavior directly in the OS, so every time you need to get a backtick, either you have to type a space afterwards, or you forget and you end up with à
, è
or ù
and a syntax error in your code.
There are some keyboard layout modifiers that exist though, but seem quite hard to fiddle with. I gave a try to Ukulele and it ended up to be fare more simple than expected, especially since you can start from the actual active keyboard layout and modify only what you need.
The culprit is that you have to choose the correct base keyboard, and scheme. And the options are a little bit overwhelming if you have never used a software like that. I'm detailing it with screenshots down here so you can reproduce at home.
TL,DR; Switch to the next title if you don't really care about the process — I made a few bundles that are easy to install if you have a French keyboard and want to have this behavior.
Ukelele process
Open Ukelele. You are greeted with a blank keyboard, you can close it or ignore it.
In the menu, go to "New from current input source". Of course, you have chosen your preferred input source beforehand :
If all goes well, you got this window :
And if you double-click the name of the keyboard layout, the keyboard opens :
Now double-click on the dead key you want to modify the behavior of (the backtick here) and select the "Make Output" tab. Input the final character, and click OK :
The key in question should become blue (and not yellow, like it was before) :
Finally, save it somewhere if you wish, and install the keyboard (It's recommended to rename it before, it's in the "Info" window) :
And you're done !
If you're lazy, here you go with the bundles ready to go :
French Mac Keyboard with backtick as an output key
File : French-backtick.bundle
French Numerical Mac Keyboard with backtick as an output key
File : French-Num-backtick.bundle
French Mac Keyboard layout with backtick and circumflex accent as output keys
File : French-backtick-circumflex.bundle
To install them, first copy the .layout
file in /Library/Keyboard Layouts
(all users), then open the Keyboard preferences and add the new layout to your preferred ones in the Input Sources tab. It will be under the "French" Language section.
It will then show up in the menu like this :
Tadaa !