Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: user-defined functions in KeyEventTranslations.tr

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112256] Re: user-defined functions in KeyEventTranslations.tr
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Tue, 7 Sep 2010 02:00:33 -0400 (EDT)

On Sun, 5 Sep 2010 05:27:28 -0400 (EDT), AlexG wrote:
> Mathematica would be about 200% more useful if I could call my own
> functions from KeyEventTranslations.tr. Does anybody know a way of
> accomplishing this? On this board, examples of item entries in the
> file take this form:
> Item[KeyEvent["...", Modifiers -> {...}], FrontEndExecute[...]
>
> Is there any way to communicate with the Kernel through
> FrontEndExecute[] here?
>
> Thanks, All

You can make this work by wrapping the thing you wish to evaluate in
KernelExecute, and by adding the option MenuEvaluator->Automatic to the Item[]
listing.  E.g.,

	Item[KeyEvent["F8"], KernelExecute[Print["F8 was pressed"]],
MenuEvaluator->Automatic]

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


  • Prev by Date: Re: Help with differential equation
  • Next by Date: Re: Holding arguments of a family of functions
  • Previous by thread: user-defined functions in KeyEventTranslations.tr
  • Next by thread: Re: user-defined functions in KeyEventTranslations.tr