0

The issue is pretty simple. Tildes have two forms:

  • The combining tilde, which is a diacritic (ñ, ã).
  • The "single" tilde, ~, notably used as a replacement for $HOME.

The French MacBook Pro keyboard uses the first one (Option + n or Alt + n - the option key is labelled Alt on a French keyboard). You have to press space to validate the single tilde (entering Alt+nthen spacewill output ~ (without a space after). It is an issue in application like Vim, where ~ changes the case. Using the French keyboard it will change the case for two letters, which is very annoying. What is more, I never used the tilde as a diacritic since I first touch a computer keyboard.

This is why I would like to remap this key. This question says that it's possible with Ukulele, but I wanted to know:

  1. Is it possible with KeyRemap4MacBook, which I also use?
  2. Is there another easy way to do it?

Thanks!

charlax
  • 113

1 Answers1

1

You can use KeyRemap4MacBook to automatically add a space when you press Option+N

The syntax for sending multiple keystrokes is like this according to the manual:

<autogen>
  __KeyToKey__
  KeyCode::N, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION,
  KeyCode::N, ModifierFlag::OPTION_L,  KeyCode::SPACE
</autogen>

This code will produce a ~ without behaving like a dead key (technically it still is).

If this still messes with VIM or other programs, you can let KeyRemap4MacBook switch input language to English on keydown, send a tilde, and then switch back to your regular language.