Posted to tcl by aspect at Wed Jul 01 07:32:24 GMT 2015view raw

  1. package require Tk
  2. foreach ev {Enter Leave Button-1 Button-2 Button-3} {
  3. bind . <$ev> "puts {<$ev> on %W}"
  4. }
  5.  
  6. # click once in the window and observe the events generated for each button.
  7. #
  8. # Expected: click once with button $N -> single event:
  9. # Button-$N
  10. #
  11. # Unexpected: click once with button 1 -> extra events:
  12. # Leave
  13. # Enter
  14. # Button-1
  15. #
  16. # unexpected behaviour witnessed on linux xorg + spectrwm window manager.
  17. # Only with Button-1. Enter/Leave otherwise seem to behave normally.
  18. # Could not replicate by exchanging wm for metacity or mutter.