#!/bin/sh
#
# $Source: /home/nlfm/Working/Zircon/Released/RCS/findMeta,v $
# $Date: 1996/09/24 09:14:41 $
# $Revision: 1.18.1.1 $
#
# ----------------------------------------------------------------------
#   AUTHOR:  Lindsay Marshall <lindsay.marshall@newcastle.ac.uk>
# ----------------------------------------------------------------------
# Copyright 1995 The University of Newcastle upon Tyne (see COPYRIGHT)
# ======================================================================
#
for wish in wish4.2 wish4.1 wish wishx dpwish 
do
  if $wish -f  <<'+'
wm title . "Hunt the Meta key"
wm resizable . 1 1
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
bind .msg <Key> "stroke {} {%A} {%K} {%k}"
foreach x {Control Shift Lock Meta Alt} {
    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!!"
