Remap combining tilde to tilde (French keyboard on Mac Os X)

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

Posted 2011-12-09T20:16:46.367

Reputation: 103

I didn't find anything in http://pqrs.org/macosx/keyremap4macbook/list.html, but you could add a remapping yourself in private.xml. It's not possible with DefaultKeyBinding.dict because dead keys can't be reassigned.

– Lri – 2011-12-09T21:47:59.183

The only viable option mentioned in this question was to create a new .keylayout with Ukelele: How to disable inputing characters like ãâà by default in OS X? I just want to simply type ~^`

– Lri – 2011-12-13T19:19:41.513

Answers

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.

Adam Wern

Posted 2011-12-09T20:16:46.367

Reputation: 26