Message Boards Message Boards

0
|
6003 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to create keyboard shortcut for forced Page Break

Posted 10 years ago

I am attempting to create a keyboard shortcut for a "forced page break". I do realize I can use the menu to insert a page break. And I do know that I can use a palette as well. However, I'd like to create a shortcut using a key+modifierkey as I use page breaks a lot.

I did some digging and found that I can assign a Front End Token to a key+modifierkey, however, there is no front end token for page break that I can see. Here is the article I am referencing: http://mathematica.stackexchange.com/questions/16165/how-can-i-set-a-keyboard-shortcut-to-run-a-command

In the article they show how to create a keyboard shortcut to print "x=1". However, if I could create one using using a frontendtoken the same way. I just can't seem to find it. It seems as if every other menu command has a frontendtoken.

Any advice? Thank you.

POSTED BY: Michael McCain
FrontEndExecute[
 FrontEnd`AddMenuCommands["DuplicatePreviousOutput", {Delimiter,

   MenuItem["pagebreak", FrontEnd`KernelExecute[

     {
                          SelectionMove[InputNotebook[], After, Cell], 

      NotebookWrite[ InputNotebook[], 
       Cell["", "PageBreak", PageBreakBelow -> True], After]}], 
    MenuKey["u", Modifiers -> {"Control"}], 
    System`MenuEvaluator -> Automatic]}]]
POSTED BY: Michael McCain
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract