5

How can I type "ñ" with a UK layout using Alt Gr?

I'd like to be able to just press Alt Gr+ and get "ñ".

3 Answers 3

5

Ctrl+Shift+U and then write the unicode codepoint of the letter, for Ñ it is 00D1 and press Space. This works for any unicode character in most of the X applications.

Okay so it looks like I only read the title. If you want to use Alt Gr+N:

xkbcomp $DISPLAY keylayout.xkb

Open the keylayout.xkb with your favourite editor end search for the symbol which has the mapping for N, something like:

    key <AB06> {
    type= "FOUR_LEVEL_SEMIALPHABETIC",
    symbols[Group1]= [               n,               N,      braceright,               N ]
};

And change the third value (e.g. braceright) to ntilde and the fourt value (e.g. N) to Ntilde . Save and

xkbcomp keylayout.xkb $DISPLAY

After this it should work. (For me it does.) But it is only for this session, to make it permanent make a script named /etc/keylayout.sh like

#!/bin/bash
xkbcomp /etc/keylayout.xkb $DISPLAY

Make the script executable sudo chmod a+x /etc/keylayout.sh and add the next line to /etc/lightdm/lightdm.conf:

session-setup-script=/etc/keylayout.sh

Source for the Alt Gr method: link

5

The layout "English (International with AltGr keys)" has the ñ/Ñ using AltGr + n and AltGr + Shift + n. Others AltGr/with dead keys layouts has the key somewhere, but if you want a surekill you should use Unicode.

enter image description here

4
  • 1
    This one is the most practical option. With this keyboard I can type in English and Spanish without a problem. All accented vowels can also be produced with AltGr+vowel
    – Severo Raz
    Dec 12, 2013 at 19:23
  • 1
    I don't seem to have this layout available (weird). I'll have to investigate further.
    – RolandiXor
    Dec 13, 2013 at 3:57
  • 3
    Does not work a German keyboard layout! I have figured out how to type Icelandic, French, Hungarian, even Vietnamese, but the ñ is doomed!
    – imrek
    Oct 15, 2016 at 8:41
  • @DrunkenMaster German != UK layout...
    – Braiam
    Oct 15, 2016 at 10:59
0

Check out the Compose Key, configurable in many systems. The default key combination is Compose~n

You must log in to answer this question.

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