#!/bin/sh
#
# $Source: /home/nlfm/Working/Zircon/Released/util/RCS/findMeta,v $
# $Date: 1999/11/29 13:39:05 $
# $Revision: 2.0.1.2 $
#
# ----------------------------------------------------------------------
# AUTHOR: Lindsay Marshall <lindsay.marshall@newcastle.ac.uk>
# ----------------------------------------------------------------------
# Copyright 1995 The University of Newcastle upon Tyne (see COPYRIGHT)
# ======================================================================
#
for wish in wish8.3 wish8.2 wish8.1 wish8.0 wish4.2 wish4.1 wish
do
if $wish -f <<'+'
wm title . "Hunt the Meta key"
wm resizable . 1 1
proc metahelp {} {
.msg configure -text {If you cant find a Meta key, use the xmodmap\
command to find out which modifier keys are defined for your keyboard and\
what they are assigned to. Pick one that will not conflict with other usage\
and add to your preferences file:
net meta <modifier name>
where <modifier name> is something like Mod1, Mod2 etc. This key will then\
function as the meta key when you use zircon. You can also xmodmap to set the\
Meta assignment directly - RTFM.
}
pack forget .stroke
.help configure -text Quit -command exit
}
proc stroke {mod t1 t2 t3} {
switch $mod {
Meta- { bell ; set fg red }
default { set fg black }
}
.stroke configure -text "$mod$t2 ($t1) ($t3)" -fg $fg
}
#
message .msg -width 200 -text {Move your mouse into this window and type \
various key combinations - The keystroke will be described \
below. If the bell rings you have found the Meta modifier key!
Double click button 1 to exit.} -fg blue
pack .msg -fill both -expand 1
pack [label .stroke -text {} -relief raised -borderwidth 2] -fill x
pack [button .help -relief raised -text {I give up.
I can't find a meta key
What do I do now?"} -command metahelp -foreground red] -fill x
bind .msg <Key> "stroke {} {%A} {%K} {%k}"
foreach x {Control Shift Lock Meta Alt Mod1 Mod2 Mod3 Mod4 Mod5} {
bind .msg <$x-Key> "stroke $x- {%A} {%K} {%k}"
}
bind .msg <Double-1> exit
bind .stroke <Double-1> exit
focus .msg
+
then
exit
fi
done
echo "Cannot find a tcl/tk interpreter!!"
syntax highlighted by Code2HTML, v. 0.9.1