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 "ñ".

Artur Meinild
  • 31,035
RolandiXor
  • 51,797

3 Answers3

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

Artur Meinild
  • 31,035
falconer
  • 15,334
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

Braiam
  • 69,112
0

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

phil294
  • 639