67

This is a new problem that I did not have a few weeks ago.

I have a Logitech Illuminated Keyboard running on Mac OS X 10.6 (Snow Leopard).

The problem is that I cannot type a tilde (~).

Instead, when I press the tilde ~, I get this character:

§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

I cannot for the life of me figure this out, except that I vaguely remember I can asked to redetect the Mac keyboard layout for this keyboard, and I think I chose the wrong one.

Now I get this weird character when pressing tilde. How can I fix this? Or how can I redetect this keyboard layout?

Brock Woolf
  • 1,966

17 Answers17

32

On a keyboard with that <>| button between the left Shift and Z, holding down Shift and pressing that button works on my end. Neither Alt+5 nor Alt+N do the trick on my end.

Giacomo1968
  • 58,727
Teekin
  • 496
30

The correct way to fix your problem is to get your Mac to re-detect your keyboard type.

Open your Keyboard preferences (System preferences → Keyboard) and on the bottom left side you will see a "Change Keyboard Type" button.

Keyboard - System preferences

Click on it and follow the instructions.

30

Here is how to swap the § key with ~. I use Karabiner to do that, and it's pretty easy to use. Just look for that option which is included in the default ones among others.

Enter image description here

It can also be used to remap other keys if you want. For example, you can use the hjkl keys to emulate the arrow keys (Vim users will love it).

goerwin
  • 401
18

With Karabiner Element, it can be done by swapping non_us_backslash and grave_accent_and_tilde keys like so:

Karabiner Elements Simple Modifications screenshot

I needed this setup for my German keyboard which is used with both an English and German layout.

AndiDog
  • 736
16

If you download a program called Ukelele, you can make custom keyboard maps.

Then you need to put the keyboard map into ~/Library/Keyboard Layouts/, log off and then back in.

Once you have done this you can choose your custom keyboard layout and you will be able to use the ~ key without any problem (I'm using a Logitech illuminated keyboard using the default Logitech-UK keymap that comes with Ukelele and everything works).

10

Usually the ~ character is associated with the "n" letter. So you can do ~ using the Option+N keys.

When you do not know how to type a character, you should try the keyboard viewer in the last tab of the "Language and Text" icon of the preferences panel.

Luka
  • 274
5

On a Mac, tilde can be obtained using the key combination Alt+5.

Let me stress that Alt+5 returns tilde ~, whereas Alt+n returns tilde as character apice ˜.

Journeyman Geek
  • 133,878
dario
  • 59
5

What characters you get by typing with key, , or combination of the two (there's also , remember) depends on which language keyboard you use.

To find out all characters on your keyboard enable Keyboard & Character Viewer in Input Sources inside Language & Text.

With U.S. keyboard type ` (near the left Shift button).

slhck
  • 235,242
Mantvis
  • 51
2

The best and easiest way is:

  1. Shift+` Obs.: Between left Shift and z

  2. Then s p a c e

show on keyboard

Io-oI
  • 9,237
wakedeer
  • 121
2

On my MacBook Air with a Danish keyboard layout, the ~ key combination is alt + ^.

Leo
  • 21
2

In my case, on OS X v10.9.1 (Mavericks), ~ on my German MacBook Air, using a US American layout, is mapped to Shift and the key directly to its right.

k0pernikus
  • 2,652
0

You can remap using this file:

~/Library/LaunchAgents/com.example.KeyRemapping.plist

You can use this tool to generate the configuration:

You just need these two lines in the "UserKeyMapping" section:

{
    "HIDKeyboardModifierMappingSrc": 0x700000064,
    "HIDKeyboardModifierMappingDst": 0x700000035
}

This will map the "Keyboard Non-US" to be "Keyboard Grave Accent and Tilde".

Giacomo1968
  • 58,727
Mostafa
  • 11
  • 4
0

For me the answer was to do the System preferences -> Keyboard -> "Change Keyboard Type" operation in the answer https://superuser.com/a/1277702/501186 - BUT, instead of using the ISO option it suggested, I needed to choose the ANSI option.

Even though I'm in the UK, all my keycaps now reflect the right values.

I'm using a Logitech K860. This never used to be a problem, until my keyboard started randomly disconnecting and I performed a reset on it.

Moby Duck
  • 151
0

I encountered a similar problem where I had a German keyboard with an English keyboard layout and the window switcher in Mac OS X was supposed to be activated by pressing Cmd + ~.

However, when I pressed it, it didn't work as expected. While some previous answers in here work, they don't apply to Mac OS X v13.1 (Ventura) since the system preferences menu has changed. I was able to fix the problem by going to System PreferencesKeyboardKeyboard shortcutsKeyboard and then reset the ”Move focus to status menus” to Cmd + `.

Enter image description here

Flov
  • 1,089
0

In my MacBook (2007) keyboard I get the ~ by combining Shift+` (the next key to the right).

Giacomo1968
  • 58,727
0

I set up the KeyRemap4MacBook application and type ~ with Shift + escape.

Setting the tilde key to Shift + Escape in KeyRemap4MacBook

Maxim Yefremov
  • 1,295
  • 5
  • 16
  • 22
0

And for those among us using a Mac keyboard with a Spanish keyboard layout, the ~ key combination is alt + ñ (the Spanish ñ, instead of n).