Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help: <Shift-Key-BackSpace> not bindable on Linux

75 views
Skip to first unread message

Coot

unread,
Jan 13, 2004, 10:08:34 PM1/13/04
to
Python 2.3.0, Tk 8.4.2
Linux 2.4.22-21mdkenterprise SMP

I'm not able to bind Shift-BackSpace or Control-Shift-BackSpace on
Linux, though it works fine on Windows. Any ideas of what is
preventing it or how I can get this to work?

To reproduce the problem, here is a tk program ... save this in a file
called SCBS.tcl, then run it on Linux (chmod u+x SCBS.tcl first) and
on Windows (from the command line, say "wish" and then load the file
using File | Source in the wish console). Click inside the text box to
give it focus, and then hit backspace and ctrl-backspace and
shift-backspace and shift-ctrl-backspace. You'll see informative
messages on standard out.

[BEGIN - this line not part of the program]
#! /usr/bin/wish

text .t -width 40 -height 20
pack .t

bind .t <Key-BackSpace> BS
bind .t <Control-Key-BackSpace> CBS
bind .t <Shift-Key-BackSpace> SBS
bind .t <Shift-Control-Key-BackSpace> SCBS

proc SCBS {} {
puts "OK: <Shift-Control-Key-BackSpace>"
}

proc SBS {} {
puts "OK: <Shift-Key-BackSpace>"
}

proc CBS {} {
puts "OK: <Control-Key-BackSpace>"
}

proc BS {} {
puts "OK: <Key-BackSpace>"
}
[END - this line not part of the program]

On Win2K, I see messages for all 4 key combinations. On my Linux box,
I don't see any messages if I have the shift key down (in fact
"shift-backspace" actually enters "\b" into the text widget window).

--
Dave Hein

Donald Arseneau

unread,
Jan 14, 2004, 12:30:09 AM1/14/04
to
dh...@acm.org (Coot) writes:
[subj]

It works for me.

I would have to guess that your "Backspace" key is set up to
generate the Delete character (look in .Xmodmap, if any).

Try "wish"ing with:
bind . <Key> {puts "Keysym %K"}
to determine what the Backspace key is generating.

Donald Arseneau as...@triumf.ca

Andreas Leitgeb

unread,
Jan 14, 2004, 5:00:44 AM1/14/04
to
Donald Arseneau <as...@triumf.ca> wrote:
> dh...@acm.org (Coot) writes:
> [subj]
> It works for me.
For me, too. (i use icewm)

If your script shows no reaction at all for certain modifiers, then
most likely your windowmanager "eats" up this event. See your
windowmanager's setup, to see what BackSpace with those modifiers
is assigned to.

If you see some effect in your prog, but not the one you expected,
then Donalds comment about .Xmodmap (or the program xmodmap) may be
the better one for your problem.

Donald Arseneau

unread,
Jan 14, 2004, 6:22:55 AM1/14/04
to
Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at> writes:

> If your script shows no reaction at all for certain modifiers, then
> most likely your windowmanager "eats" up this event.

Yes, of course! Like <Control-Alt-Backspace>.

Donald Arseneau as...@triumf.ca

Coot

unread,
Jan 14, 2004, 10:20:14 PM1/14/04
to
Donald, Andreas,

Thanks for your help. You definitely put me on the proper track.

xmodmap -pke showed that keycode 22 was properly mapped to BackSpace,
but that Shift-BackSpace was mapped to Terminate_Server.

Now, that key-combination didn't actually terminate the XFree86
server. That seems to be because of keyboard mappings set up by xkb.

There is some sort of conflict between xkb and xmodmap. In fact the X
startup scripts on my system make great pains to detect whether xkb is
in use and will refuse to invoke xmodmap if that is the case.

That aside, if I issue an "xmodmap mymodmap" where the mymodmap file
contains:

keycode 22 = BackSpace

then all is well -- Tk now sees the Shift-BackSpace.

The downside is that I can't do this at startup of X .. I have to
manually execute this step after X has completely finished startup.

I've been looking at the xdb config files to try to see if there is
something I could change there, but that is infintely more complex
than xmodmap ... so perhaps some day when I have more time I'll figure
that out.

Again, THANKS for your help ... I've at least a tolerable workaround
:-)

--
Dave Hein
Donald Arseneau <as...@triumf.ca> wrote in message news:<yfi4quy...@triumf.ca>...

0 new messages