How can I type a backslash with no backslash key?
Solution 1
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"
Solution 2
I have found out that Alt Gr+- gives \
.
Solution 3
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
Solution 4
If you do not have Alt GR in your keyboard, simply press and hold left ALT then type 92.
Solution 5
You can find a full list of ALT codes here.
Or try Alt+Shift+:
On the German keyboard backslash is Alt+Shift+7
Related videos on Youtube
wim
Hi from Chicago! Python dev with interest in mathematics, music, robotics and computer vision. I hope my Q&A have been helpful for you. If one of my answers has saved your butt today and you would like a way to say thank you, then feel free to buy me a coffee! :-D [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
Updated on September 18, 2022Comments
-
wim over 1 year
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.
-
Admin over 10 yearsWell, 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.
-
Admin over 10 yearsI 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.
-
Admin over 10 yearsyou could try to make your own keyboard layout with MS KLC (microsoft keyboard layout creator) that might work.
-
Admin over 10 yearsplease 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?
-
Admin over 10 yearsalso, 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 replacementlaptopkeys.com/images/…
-
Admin over 10 years
-
-
wim over 10 yearsUnfortunately, Alt + Shift + : gives me no output. And I can't enter alt codes because I don't have a numeric keypad.
-
Daniel R Hicks over 10 years@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".
-
wim over 10 years@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.
-
Daniel R Hicks over 10 yearsOn 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.
-
wim almost 10 yearsI mentioned in the post that this gives me planking L
¬
-
Rory over 9 yearsThis 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.
-
dorien almost 9 yearsomg if I had know this sooner, it would have saved me a year of switching gb-us all the time...
-
yass about 7 yearsIt depend of the Keyboard and Language
-
m3dl over 3 yearsIt worked here! Thank you!
-
boardtc over 3 yearsDoesn't work for me for some reason :-(
-
Markus Bawidamann almost 3 yearsNope, does not work.
-
Admin almost 2 yearsThank you for this simple solution. note for others: this only works with the - above the keyboard, not the - on the numpad.