How would I define, say < and >, or the left arrow key and right arrow key as keyboard shortcuts for moving forward and backward in slideshows?


1 Answer 1


Evaluate one line once inside the notebook (or creating a button) will do:

 NotebookEventActions :> {{"KeyDown", ">"} :> 
    FrontEndTokenExecute["ScrollPageNext"], {"KeyDown", "<"} :> 

or, using left and right arrows, but a bit more trickery to preserve normal arrow behaviour in the "Working" environment:

  NotebookEventActions :> {"RightArrowKeyDown" :> 
     If[CurrentValue[SelectedNotebook[], ScreenStyleEnvironment] =!= 
      SelectionMove[SelectedNotebook[], Next, Character], 
    "LeftArrowKeyDown" :> 
     If[CurrentValue[SelectedNotebook[], ScreenStyleEnvironment] =!= 
      SelectionMove[SelectedNotebook[], Previous, Character], 

Interestingly enough the PageUp and PageDown keys always are already defined to navigate forward and backward, but one sometimes wants other keys in order to use a programmable (air)mouse.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.