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?
- Follow-Ups:
- Re: no Condition in EventHandler?
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: no Condition in EventHandler?