35

I'm trying to use a UK keymap on a physical US keyboard on my notebook (Asus Zenbook UX31E). My keyboard has vertical bar and backslash (| and \) above the Enter key, but I get hash and tilde instead. On UK keyboards, pipe and backslash seem to be just to the left of the Z key. Unfortunately, I don't have that physical key at all; instead, I just have a fat left Shift key. They needed an extra key to make room for £ and €, so things have moved around a bit, I guess.

I need vertical bar (for pipe) all the time in Linux, and, fortunately, found that with Right Alt+`.

Is there any similar trick for getting a backslash?  Unfortunately, I don't have a numeric keypad, so I couldn't get an escape sequence like Alt+92 working.

By the way, Shift+` gives me the "not" sign, ¬ (which I call "planking L").  I don't think I'll ever need that, so whilst an existing sequence to get a backslash is preferable, a solution that allows me to map backslash onto Shift+` is also acceptable to me.

By the way, I am using Gnome / Ubuntu 13.10.

wim
  • 3,327

15 Answers15

28

I have found out that Alt Gr+- gives \.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
mriklojn
  • 389
22

Press the alt key to the right of the space bar (alt gr), and the key above the enter key (which should typically be hash on a US keyboard set to UK input - but on your laptop it is actually the \ key!). This should provide a backslash!

altGR+#( \ )key

Kevin Panko
  • 7,466
ikinone
  • 321
7

If you do not have Alt GR in your keyboard, simply press and hold left ALT then type 92.

4

You can find a full list of ALT codes here.

Or try Alt+Shift+:

On the German keyboard backslash is Alt+Shift+7

davidcondrey
  • 1,748
3

I use a European keyboard and have only a forward-slash /.

Using the alt to the right of the space bar (alt gr) together with the key for / gives |.
Using alt to the right of the space bar (alt gr), plus shift, plus key for / gives backslash \.

Nifle
  • 34,998
2

I have now remapped planking L (¬) to backslash (\) using the following shell script at startup. I am using gnome / Ubuntu 13.10 on an Asus Zenbook.

#!/bin/sh
xmodmap -e "keycode 49 = grave backslash grave notsign bar bar bar bar grave asciitilde"
wim
  • 3,327
2

If you are controlling a windows machine remotely that is set to UK then open the "On-screen keyboard" It's in All Programs | Accessories | Ease of Access. You will now see a representation of a keyboard on the screen!

Under the "Keyboard" menu you should have Enhanced Keyboard and 102-keys selected. This gives you the extra UK backslash key.

All the UK servers I control, I now pin the on-screen keyboard to the start menu now so I can get to that key fairly easily. I could set the machines to US keyboards, but my UK based colleagues probably wouldn't thank me for it :)

Mr McGoo
  • 141
2

I have the same issue. I bought an Asus ROG gamining laptop off Amazon and no-where did they tell me it was an american keyboard layout. I live in the UK.

what I found is you can still have your Keyboard set to your country but to get the missing key, in my case \ and #, the trick is to hold down alt and type in 92 for \ and hold alt and type 35 for #. (This method requires a numeric keypad)

There is a full list of alt codes here

I have just realised that if you don't have a keypad you can use ctrl alt and \ to get a back slash and Shift ctrl alt and \ to get the pipe |

Hope this helps :)

1

SHIFT + the key that is at the left of the "1" key, (the key at the top of TAB, or if you prefer at the bottom of ESC)

Nik
  • 11
0

On windows 8, pressing the back slash key gave me hash, but on pressing the alt gr + back slash key I got the back slash.

0

I have just run into this problem on Windows 10. My computer does not have an Alt key to the right of the space bar (Alt Gr) and the Alt + [numbers] doesn't work. I found the solution through trial and error - Ctrl + Shift + \ (key above the Enter key).

lonestorm
  • 101
0

Encountered this issue on a Mac and option+- gave ½ instead of a backslash. I found that if I do command+- and then option+- right after it types a backslash.

Depending on the layout printed on your keys, it might also be + you need to use instead.

0

To solve this problem, Simply go to keyboard layout seetings on the control panel and change the keyboard layout to US and save. Proceed as follows; Settings-Control panel-Clock,language,region-Change Input method

Gbemi
  • 11
-1

Settings > Time and Language > Region and Language > Add a Language > English (US) Honestly the easiest solution, since your keyboard is a US layout.

Adam
  • 1
-1

I exactly have this issue with my BT keyboard attached to Samsung Galaxy TabS7. Additionally I had issue with my @+2 key. Solution Went to language settings, Turned off English UK & Turned on English US. Do not multi-select input languages, need to be one only