Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-23-2011, 06:30 AM   #1
LQ Newbie
Registered: Apr 2010
Posts: 26

Rep: Reputation: 0
How to map Shift+Del to Backspace

One of the very few things I miss from Windows is that when you press LeftShift+Del the delete key acts like the backspace key, in other words you can use Del to delete forwards and LeftShift+Del to delete backwards.

I've been reading man pages such as xmodmap and used xev to get keycodes but I can't work out how to map LeftShift+Del to Backspace.

Can someone tell me how to do this please?


PS. Using Ubuntu Lucid.
Old 02-23-2011, 11:22 PM   #2
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You can possibly add it in keyboard shortcuts.
It's under System>>Preferences>>Keyboard Shortcuts.
You'll need to make sure that it's not reserved though.
Old 02-24-2011, 12:56 PM   #3
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: CentOS, Xubuntu
Posts: 5,034

Rep: Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661
Keyboard shortcuts is for binding keys to a command.

The file /usr/share/X11/xkb/symbols/pc has the line
key <DELE> { [ Delete ] };
If you alter that to
key <DELE> { [ Delete, BackSpace ] };
that should do it (with both shift keys).
1 members found this post helpful.
Old 02-24-2011, 01:38 PM   #4
LQ Newbie
Registered: Apr 2010
Posts: 26

Original Poster
Rep: Reputation: 0

I got help somewhere else and this sorts it as well:

xmodmap -e "keycode 119 = Delete BackSpace"

Keycode 119 being what xev returns when del is pressed.

Old 02-25-2011, 07:07 AM   #5
LQ Newbie
Registered: Apr 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Using: Ubuntu (Lucid) - not sure if the following is Ubuntu specific or Gnome specific, but it works for me.

In case anyone has found this with a search and also wants to know how best have the xmodmap command load on bootup here's how to do it.

To get xmodmap commands to load on startup:

Create the file: ~/.Xmodmap
That is a file called .Xmodmap in your home dir. Note: Capital X is not a typo.

Instead of using xmodmap commands in the file just use the expression part of the command in the .Xmodmap file:

So an xmodmap command like this:

xmodmap -e "keycode 119 = Delete BackSpace"

Should become like this for the .Xmodmap file:

keycode 119 = Delete BackSpace

If you have more than one command place each one on its own line.

On reboot a dialog box will ask which files to load every time, the dialog box has 2 columns 'available files' and something like 'load these files'. .Xmodmap will be listed in the available files list so move it to the load these list. Tick the 'don't show every time I reboot' box if you don't want it shown after every boot.

Note: To get that dialog box back on reboots (if you ticked 'don't show every time' box):

Load gconf-editor and navigate to:

Desktop --> Gnome --> Peripherals --> Keyboard --> General

Then edit the known_file_list entry to remove the .Xmodmap file, after rebooting the dialog box will be displayed again (you may need to move the .Xmodmap back to the 'load these files' column again - can't remember).


Last edited by mattst; 02-25-2011 at 07:09 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
command executed on trapping Shift+Del fatal_err0r Linux - Newbie 4 07-03-2008 03:39 PM
Shift + Backspace resets X manicman Linux - Newbie 2 05-29-2006 11:05 AM
shift-backspace, can I change it? post_break Ubuntu 0 03-20-2006 12:27 AM
Shift + Backspace = Trouble chris319 Linux - Software 14 08-25-2004 06:13 AM
Shift Backspace SuSE 9.0! Help! AFGNCAAP Linux - General 1 07-31-2004 12:25 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration