I would like to create a Manipulate slider that iterates over a discrete set of items. Something like the following

Manipulate[u, CharacterRange["a","z"]]

produces a drop-down menu, which doesn't have a great interaction style. I must move the mouse back up to the top to get a new item, taking my eyes off the display back to the controls, rather than being able to just slide around without having to look at the controls too often.

Even better would be some kind of keyboard control that would let me left-and-right arrow my way through a collection. Then I'd never have to take my eyes off the target display. But that would be too intuitive [sarcasm].

  • 2
    $\begingroup$ Manipulate[u, {u, CharacterRange["a", "g"], ControlType -> Slider}] $\endgroup$
    – Kuba
    Jun 26, 2013 at 19:43

1 Answer 1



 {u = CharacterRange["a", "e"]},
   {"MouseClicked", 1} :> (u = RotateLeft[u, 1]), 
   {"MouseClicked", 2} :> (u = RotateRight[u, 1])

enter image description here

But since second button is showing menu it is not very useful :) It is only a method so You can change event trigger.

You can also take a look at NotebookEventActions. Or CellEventActions:


DynamicModule[{u = CharacterRange["a", "e"]},
   TextCell[Dynamic@First@u, "Output", 
    CellEventActions -> {"LeftArrowKeyDown" :> (u = RotateLeft[u, 1]),
                         "RightArrowKeyDown" :> (u = RotateRight[u, 1])}

This is what I like the most. But then You are not able to move selection cursor with arrows, not so much important but it depends what are You doing. :)

Standard way


 Manipulate[u, {u, CharacterRange["a", "g"], ControlType -> Slider}]

enter image description here


Edit "StepLeftButton" does not work here how I expected. Anyone has an idea why? (I will remove it till explanation)

Manipulate[u, {u, CharacterRange["a", "g"], ControlType -> Manipulator, 
   AppearanceElements -> {"StepRightButton"}, Appearance -> "Open"}]

enter image description here

  • $\begingroup$ In the "Standard way" Manipulator, answer, the "StepLeftButton" doesn't seem to work :( $\endgroup$
    – Reb.Cabin
    Jun 26, 2013 at 21:54
  • $\begingroup$ @Reb.Cabin You are right. I'm not sure why it is so... $\endgroup$
    – Kuba
    Jun 26, 2013 at 22:01

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.