You are not logged in.

#1 2012-04-07 14:10:14

diederick76
Member
Registered: 2010-02-14
Posts: 169

xmodmap Map Delete to Shift+BackSpace

Hi,

I have a keyboard that lacks a Delete (erase character to the right) key but has a BackSpace key (erase character to the left and move one position to the left). I would like to make Shift+BackSpace act as a Delete. After reading https://wiki.archlinux.org/index.php/Xmodmap, I thought I'd do that like so:

# xmodmap -e "keycode 22 = BackSpace Delete"

However, that doesn't work. BackSpace works fine, but Shift+BackSpace types "2~" (a two and a tilde). Strangely,

# xmodmap -e "keycode 22 = Delete BackSpace"

works as expected: the BackSpace key now act as a Delete, and combine with Shift it is a BackSpace. The exact same thing happens when I use keycode 21 (normally mapped to 'equal  plus'), for instance. Can someone explain to me what I'm missing?

Thanks!

Last edited by diederick76 (2012-04-08 14:19:26)

Offline

#2 2012-04-08 14:06:01

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: xmodmap Map Delete to Shift+BackSpace

BTW: When I add this line:

key <BKSP>  { [ BackSpace,     Delete,    BackSpace,       Delete ] }

or this line

key <BKSP>  { [ Delete,    BackSpace,     Delete,    BackSpace,   ] }

to the symbols file in /usr/share/X11/xkb/symbols/ that I use (which is gb), I get exactly the same results as with using xmodmap. The second one works as expected, the first one produces a BackSpace without Shift, or a "2~" with Shift.

Anyone any ideas?

Offline

#3 2012-05-01 05:46:44

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: xmodmap Map Delete to Shift+BackSpace

Does anyone know of a forum or mailing list where I can post these questions?

Offline

#4 2012-05-01 06:08:28

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: xmodmap Map Delete to Shift+BackSpace

Are you using a terminal to check if it works?
Terminals can do their own things with keys.


You're just jealous because the voices only talk to me.

Offline

#5 2012-05-01 09:28:13

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: xmodmap Map Delete to Shift+BackSpace

You're right. When I issue the above and then press shift+backspace:
xev: state 0x1, keycode 22 (keysym 0xffff, Delete), same_screen YES (Yay!)
console: 2~
KDE text editor: "Error: Ambiguous shortcut detected"
Firefox text input: *Nothing*

This is very frustrating. KDE can be configured, but if Firefox doesn't work it's of no use to me. Do you have any ideas on how to do this at the OS/Xorg level?

Offline

#6 2012-05-01 21:49:10

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: xmodmap Map Delete to Shift+BackSpace

Seems like it isn't a straightforward thing to do. From what I could find, you can use xmodmap in X, .Xdefaults for xterm etc and since toolkits like qt and gtk do their own thing with the keycode returned from keypresses you have to use their own gonfiguration editors.


You're just jealous because the voices only talk to me.

Offline

Board footer

Powered by FluxBB