How can I type a backslash with no backslash key?

22

8

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

Posted 2014-01-15T01:30:20.697

Reputation: 2 523

1Well, the key to the left of the Z key seems to only be there on UK keyboards. Perhaps you should switch to the "international" keyboard layout that puts the UK pound on RightAlt+Shift 4 and the Euro on RightAlt 5. – Daniel R Hicks – 2014-01-15T02:04:45.400

I used to use a UK keyboard with a Japanese IME input. For some reason, backslash was not mapped and instead ¥ (yen) worked as a perfect replacement in terminal. – Reuben L. – 2014-01-21T20:16:25.183

you could try to make your own keyboard layout with MS KLC (microsoft keyboard layout creator) that might work. – barlop – 2014-01-21T20:51:44.740

please include a screenshot of the keyboard, that may help some people think of things. or others see the problem more clearly. And by the way, why not use a US layout for the US keyboard? – barlop – 2014-01-21T20:56:42.290

also, I found this comment on a forum, it may help. "I had the same problem, and it took me a long time to figure it out. In the top row of keys, right after the F* keys I finally found a small blue picture of a lock. This is the number lock key. Push the FN and the number lock key once to turn on the 10key function in the Qwerty keys and push them both again to turn it off." That said, I see no lock here though I can't zoom in much http://www.replacementlaptopkeys.com/images/asus_zenbook_ux31_laptop_key.jpg

– barlop – 2014-01-21T20:57:12.103

Answers

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

Posted 2014-01-15T01:30:20.697

Reputation: 2 523

21

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

mriklojn

Posted 2014-01-15T01:30:20.697

Reputation: 311

1omg if I had know this sooner, it would have saved me a year of switching gb-us all the time... – dorien – 2015-06-22T20:31:12.030

14

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

ikinone

Posted 2014-01-15T01:30:20.697

Reputation: 141

This works for me using a physical US (ms surface pro 3) keyboard running in UK mode in windows 8. Also note Windows-SPACE switches between languages in windows, which can be really helpful. – Rory – 2014-09-09T13:17:26.980

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

Posted 2014-01-15T01:30:20.697

Reputation: 1 345

Unfortunately, Alt + Shift + : gives me no output. And I can't enter alt codes because I don't have a numeric keypad. – wim – 2014-01-15T10:22:50.510

@wim - I've never seen a keyboard sans keypad that didn't have the numeric keys "shadowed" on the right-hand side of the alpha keyboard. To access it you use "NumLk". – Daniel R Hicks – 2014-01-15T12:22:12.600

@DanielRHicks I've heard of numeric keypads being accessible with 7,8,9,U,I,O,J,K,L on notepads before, but I've never got it working because I don't seem to have a num lock key! Unless it is some obscure sequence. There isn't anything obviously labelled NumLk on my keyboard.

– wim – 2014-01-15T12:55:36.763

On my keyboard (on a Sony Vaio) with identical layout the NumLk key is to the right of F12. But those 4 keys on the right are labeled differently from mine. – Daniel R Hicks – 2014-01-16T12:32:43.997

4

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

Vitali Avagyan

Posted 2014-01-15T01:30:20.697

Reputation: 161

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

Posted 2014-01-15T01:30:20.697

Reputation: 131

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 :)

timmac15

Posted 2014-01-15T01:30:20.697

Reputation: 21

2

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 \.

user3672912

Posted 2014-01-15T01:30:20.697

Reputation: 21

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

Posted 2014-01-15T01:30:20.697

Reputation: 11

I mentioned in the post that this gives me planking L ¬ – wim – 2014-07-27T13:51:41.127

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.

Ahmad Hashim

Posted 2014-01-15T01:30:20.697

Reputation: 11

It depend of the Keyboard and Language – yass – 2017-04-08T18:36:51.823

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

Posted 2014-01-15T01:30:20.697

Reputation: 101

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

Posted 2014-01-15T01:30:20.697

Reputation: 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

Posted 2014-01-15T01:30:20.697

Reputation: 1