source ../library/tkSteal.tcl

frame .cmds
button .cmds.ls -text ls -command {
  .f keyclick l
  .f keyclick s
  .f keyclick Return
}
button .cmds.ps -text ps -command {
  .f sendstring "ps<Return>"
}
button .cmds.bell -text bell -command {
  xaccess xbell -interval {1 3 1 2}
}
button .cmds.test1 -text test1 -command {
  .f sendstring "aBcDe" 2
}
button .cmds.test2 -text test2 -command {
  .f sendstring "abcedfghijklmnopqrtsuvwxyz"
}
button .cmds.test3 -text test3 -command {
  .f sendstring "<Press-Shift>abcedfghijklmnopqrtsuvwxyz<Release-Shift>ab"
}
button .cmds.test4 -text test4 -command {
  .f sendstring "<greater><less><less<><less"
}
button .cmds.test5 -text test5 -command {
  .f sendstring "<space><Shift><exclam><Shift><quotedbl><numbersign><Shift><dollar><Shift><percent><Shift><ampersand><Shift><quoteright><Shift><parenleft><Shift><parenright><Shift><asterisk><plus><comma><minus><period><Shift><slash><Shift><colon><Shift><semicolon><less><Shift><equal><greater><Shift><question><Shift><at><bracketleft><backslash><bracketright><asciicircum><Shift><underscore><quoteleft><Shift><braceleft><Shift><bar><Shift><braceright><Shift><asciitilde><Control>a"
}
button .cmds.test6 -text test6 -command {
  .f sendstring {ABab^~!"@$%&/()=?`'+*\[]{}#|,;.:-_> <<>	<<
}
}
button .cmds.test7 -text test7 -command {
  .f sendstring "ghost\t\n"
}
button .cmds.id -text id -command {
  puts stdout [lindex [.f conf -windowid] 4]
  puts stdout 0x[format %x [lindex [.f conf -windowid] 4]]
}
if {$tkVersion >= 3.3} {
  button .q -text Quit -command {.f sendstring "<Control>a<Control>kexit<Return>"; exit 0}
} {
  button .q -text Quit -command {.f sendstring "<Control>a<Control>kexit<Return>"; catch "destroy ."; catch "exit 0"}
}
tksteal .f -command {xterm -iconic #+10000+10000 -n TkStealXTerm -w 0 -xrm "xterm*allowSendEvents:true" -xrm "xterm*foreground:red" -geometry 100x30+10000+10000} -name {TkStealXTerm} -width 80 -height 25 

pack append .cmds \
            .cmds.ls left \
            .cmds.ps left \
            .cmds.bell left \
            .cmds.test1 left \
            .cmds.test2 left \
            .cmds.test3 left \
            .cmds.test4 left \
            .cmds.test5 left \
            .cmds.test6 left \
            .cmds.test7 left \
            .cmds.id left 
pack append . \
            .cmds {top fill} \
            .f {top fill expand} \
            .q {top}

wm maxsize . 1000 1000

# eof

