Re: EventHandler question
- To: mathgroup at smc.vnet.net
- Subject: [mg82531] Re: EventHandler question
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 24 Oct 2007 04:21:09 -0400 (EDT)
- References: <ff4hti$k2d$1@smc.vnet.net><ffkfdu$soa$1@smc.vnet.net>
Mariusz,
Yes, this is exactly the answer that I was looking for.
I often forget about CurrentValue, which i s one of the most versatile
functions in Mathematica 6.
I actually asked one of the developers at WRI about my EventHandler
question and he gave the same advice as you.
Great minds think alike!
Best regards,
David
On Oct 23, 5:38 am, "Mariusz Jankowski" <mjankow... at usm.maine.edu>
wrote:
> David, not quite sure if this is the correct answer to your question, but
> when combining mouse and key events I did:
>
> EventHandler[ ....
> {"MouseClicked" :> If[CurrentValue["AltKey"], ..., ...]}]
>
> So, I am assuming the following should work: replace "MouseClicked" with
> "KeyDown" and use If construct to test the current value of multiple keys.
>
> Mariusz
>
> >>> On 10/17/2007 at 4:42 AM, in message <ff4hti$k2... at smc.vnet.net>, David
> Reiss<dbre... at gmail.com> wrote:
> > For Eventhandler one can specify a keyboard key that initiates the
> > action
>
> > Eventhandler[Blahblahblah, {"KeyDown","x"}:>something]
>
> > Typically the "x" must be a single keyboard character or perhaps one
> > that has an escaped representation (like \t for tab).
>
> > How do I specify a combination such as control-\ ? (i.e., a two-key
> > combination with a modifier key such as control, alt, command, or
> > such.)
>
> > When a two-key combination creates a single on-screen character then
> > this works fine. But when there is no on-screen representation then I
> > do not know how to do this...
>
> > THanks for any help...
>
> > --David