MathGroup Archive 2004

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

Search the Archive

Re: button to emulate Shift-Enter


On Aug 8, 2004, at 5:37 AM, Murray Eisenberg wrote:

> How would I create a button, for a one-button palette, that when 
> clicked
> by the mouse, sends the Shift-Enter key combination to the active
> notebook (i.e., not the palette notebook) for the cell in which the
> cursor was positioned in that active notebook?
>
> Explanation: For presentations, I want to be able to use a
> remote-control mouse device that cannot transmit any keystrokes but can
> move the mouse around the screen and transmit a left-click (or
> right-click).  So my thought is to have the sort of button, as a
> sepaately floating palette, that I could click so as to emulate 
> pressing
> Shift-Enter in the target notebook being presented.
>
> -- 
> Murray Eisenberg


Hi Murray,

Paste and then enter the following. Then select the output cell and 
choose Generate Palette form Selection from your File menu.

   ButtonBox[
     StyleBox[" Evaluate ", FontFamily->"Helvetica",
       FontWeight->"Bold", FontColor->RGBColor[0.75,0,0]],
     ButtonFunction:>(CompoundExpression[
             FrontEndTokenExecute["EvaluateNextCell"],
             FrontEndTokenExecute["EvaluateNextCell"]]&),
     ButtonEvaluator->Automatic, ButtonMinHeight->1.5,
     Background->GrayLevel[0.9]]//DisplayForm


Regards,

-----
Selwyn Hollis
http://www.appliedsymbols.com
(edit reply-to to reply)


  • Prev by Date: Stack Error - is there something I can do about it ?
  • Next by Date: Re: UnrankPermutation newbie problem .. Combinatorica Package
  • Previous by thread: Re: button to emulate Shift-Enter
  • Next by thread: Re: button to emulate Shift-Enter