I can get a canvas widget to honor a mouse event, but cannot get it to invoke a keyboard event. What I want to do is tie a function key <F4> to a zoom function in the canvas. But I cannot key a simple keypress or <F3> to work.
canvas $frame.worksp -width $cwidth -height $cheight \
-borderwidth 2 -relief sunken -background black
pack $frame.worksp -side bottom -expand yes -fill both
set worksp $frame.worksp
bind $worksp <ButtonPress-3> { puts "This works" }
bind $worksp <KeyPress> { puts "This fails" }
canvas $frame.worksp -width $cwidth -height $cheight \
-borderwidth 2 -relief sunken -background black
pack $frame.worksp -side bottom -expand yes -fill both
set worksp $frame.worksp
bind $worksp <ButtonPress-3> { puts "This works" }
bind $worksp <KeyPress> { puts "This fails" }