MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

no Condition in EventHandler?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100064] no Condition in EventHandler?
  • From: Michael <michael2718 at gmail.com>
  • Date: Fri, 22 May 2009 01:51:02 -0400 (EDT)

EventHandler[
 "TEST",
 ("MouseDown" :> Print[1]) /; CurrentValue["AltKey"],
 ("MouseDown" :> Print[2]) /; CurrentValue["ControlKey"],
 ("MouseDown" :> Print[3]) /; CurrentValue["ShiftKey"],
 ("MouseDown" :>
    Print[4, CurrentValue["AltKey"], CurrentValue["ControlKey"],
     CurrentValue["ShiftKey"]]) /; True,
 "MouseDown" :>
  Print[5, CurrentValue["AltKey"], CurrentValue["ControlKey"],
    CurrentValue["ShiftKey"]] /; False
 ]

Does not do what I expect.  (5 is always printed, and nothing else, no
matter what keys are down).

I can only speculate that EventHandler doesn't evaluate its actions in
such a way that a Condition has a chance to take effect or not?


  • Prev by Date: Re: GeoDistance gives other value than SpheroidalDistance
  • Next by Date: Re: Import of NIST ANOVA data sets
  • Previous by thread: Re: Trying to get closed form solution to simple recurrence.
  • Next by thread: Re: no Condition in EventHandler?