1

I have a Macbook Air with the typical US keyboard layout printed in the keys, but I want to use the keyboard as if it were a Spanish keyboard because I'm accustomed to that layout and since I don't look at the keys while typing I don't mind the layout not matching the characters actually printed in the keys.

The layout of my keyboard looks exactly like this:

Macbook Air with US keyboard layout

I have configured the keyboard to behave as if it were an Spanish one, by going to Preferences > Keyboard > Input Sources and adding the "Español - ISO" layout.

That works fine, mostly, with one exception: The key at the left of the top "1" key (with the printed characters "`~") doesn't behave the same as the key in the same position in a Spanish keyboard, even after configuring the "Español - ISO" layout.

Instead of the key being "ºª\", which is the key at the left of "1" in the Spanish keyboard, it behaves as a "<>≤" key. Why is that?

So, since this is happening, I can't use those symbols ("ºª\"), of which I miss the backslash the most. How can I get the backslash with this layout without having to switch to US keyboard just to get the backslash character (below the "delete" key), and then switching back to Spanish layout? (which is a cumbersome process just to get a single character each time).

Edit: I think the problem is that the Spanish keyboard actually has an extra key that the US keyboard lacks (please note that the Left Shift key is shorter in the Spanish keyboard to accomodate the extra "<>≤" key). Spanish Macbook keyboard layout It seems that, for some reason, the key at the left of the "1" key is actually moved (including its keycode) down to the right of the Left Shift key in European keyboards, and a completely new key with a new key code replaces the key at the left of the "1" (in the Spanish keyboard it is "ºª\", while in other European languages it's a different set of symbols but the key code remains the same), so with a US keyboard I can't really have the full Spanish layout because of the missing key.

8
  • Have you checked out this related entry? apple.stackexchange.com/questions/177320/…
    – ErniePC12
    Oct 30, 2021 at 22:44
  • Yes, I did check that before writing my question, and none of the suggested key combinations produce a backslash when using the Spanish layout on a US keyboard. I guess that the US keyboard physically generates a different key code for the key at the left of the number "1" than the one generated by that key in an actual Spanish keyboard. That's probably why the US keyboard doesn't produce the expected result when switching to Spanish layout.
    – OMA
    Oct 30, 2021 at 23:50
  • I don't know why exactly character assignments for keys might have changed for the keyboard layout you prefer with Monterey but you might be able to find where to get the backslash from under your preferred layout using the Keyboard Viewer. To see which alternative characters you can get by pressing which keys, press Alt, Shift, Ctrl, etc. alone and separately after opening the Keyboard Viewer when your preferred layout is enabled.
    – Alper
    Oct 31, 2021 at 0:02
  • This is not a problem with MacOS Monterey because I'm currently experiencing this problem on Mojave (I didn't upgrade because I needed some 32-bit apps). Also, this is probably a problem that has existed since forever (I found that US keyboards have one less key than European keyboards; see my edit above), so it has nothing to do with operating system versions. Thanks for the suggestion about using the Keyboard Viewer. I've tried it and... the backlash is NOWHERE to be found in the whole keyboard, even using Shift, Alt/Option or Ctrl, nothing! This confirms my suspicions about the missing key.
    – OMA
    Oct 31, 2021 at 0:28
  • Command-Option-6 (once) produced the backslash on an English keyboard with a Spanish layout according to this old discussion. Glad to hear you found other solutions already working.
    – Alper
    Oct 31, 2021 at 1:15

2 Answers 2

1

You can always see what every key does with Keyboard Viewer.

With Spanish ISO, there is no backslash when you are using the US (ANSI) keyboard, you need the European ISO type.

You can make a custom layout which adds this character pretty easily with Ukelele.

The Apple layout "Latin American" has \ at Option -

The Apple layout "Spanish" has \ at Option 6.

5
  • For me, Option+6 produces a "¬" character, not a backslash.
    – OMA
    Oct 31, 2021 at 0:53
  • Thanks for the Ukelele suggestion. I didn't know that software. I'll try it, to see if it's a better alternative to Karabiner Elements.
    – OMA
    Oct 31, 2021 at 0:53
  • @OMA if you switch to Spanish (it is a different input source than Spanish ISO), option 6 should produce \ Oct 31, 2021 at 1:50
  • But that's not a viable option. The "Spanish" (non-ISO) option is an ancient Apple layout used only in very old Mac keyboards (during the 90s). I never used that layout and I'm not used to it, so it would be hard to use in a US keyboard where I can't even see the keys. So it's a non-starter for me.
    – OMA
    Oct 31, 2021 at 2:05
  • @OMA Understood. In 20 years I have never seen a keyboard anywhere printed for that layout and don’t understand why it is present. It is quite common for new users to choose it by mistake when setting up their Mac. Oct 31, 2021 at 2:27
1

I finally found out that the problem is that the Spanish keyboard (and other European keyboards) actually has an extra key that the US keyboard doesn't have. Not only that, the key at the left of the "1" key has a different key code in European keyboards, because the key that is there in US keyboards was moved to the right of the Left Shift key in European keyboards (key code and everything), for reasons I can't comprehend. If the European keyboards have an extra key, why not assign a new key code to the new key, instead of replacing the key code of an existing key and then moving the old key code to the new key? I'm sure there must be a good reason for that, but I don't know it.

So, since the US keyboard has one less key, European people stuck with a laptop with a US keyboard can't really have the full layout of their language, so some compromises have to be made.

I found several solutions that work for me:

  • A little not-so-good solution because it only works on the Terminal: For some strange reason, pressing Alt+Y writes a backslash character ONLY in the Terminal application (in any other app it writes a yen ¥ symbol). It somewhat works for me because most of the time I need to write a backslash it's because I want to write an escape code in the Terminal (which begins with "\"). But it's still not an ideal solution because I might need to write a backslash in other apps.

  • Using Karabiner Elements to remap the "grave_accent_and_tilde (`)" key (the key at the left of the "1" key in the US keyboard) to act as a "non_us_backslash" key (the key at the left of the "1" key in European keyboards). This works great, because I finally get access to the coveted backslash ("\") character (as well as the "º" and "ª" numeral characters) but then I lose access to the "<>≤" characters in that key, which are very important, too, so this isn't a good solution either.

  • I can then remap the "backslash (\)" key (the US keyboard "\|" key located at the right of the keyboard above the "enter" key) to behave like the "grave_accent_and_tilde (`)" key with Spanish layout so I get the "<>≤" characters back in a different key while still keeping the "ºª\" key functioning so those characters are also accessible in the keyboard as well. But then I lose the "çÇ}" characters! I don't mind losing "ç" and "Ç" since I don't use those letters, but losing access to the closing brace ("}") character is far from ideal as well, especially if you're a developer. It would seem I can never get a completely satisfactory solution.

  • I finally settled on remapping the "caps_lock" key to behave like the "grave_accent_and_tilde (`)" key, since I seldom use the Caps Lock key anyway (I only need to write single capital letters with Shift). That way I have access to both keys at the same time ("ºª\" and "<>≤") without having to lose the "çÇ}" key in the process.

This is the best I have found, considering that the US keyboard has one less physical key than the number of keys I usually have, and the lack of a physical key of course can't be completely fixed with software workarounds.

If anyone has better ideas to solve this problem, please do comment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .