Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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].

share|improve this question
Manipulate[u, {u, CharacterRange["a", "g"], ControlType -> Slider}] – Kuba Jun 26 '13 at 19:43
up vote 4 down vote accepted


 {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

share|improve this answer
In the "Standard way" Manipulator, answer, the "StepLeftButton" doesn't seem to work :( – Reb.Cabin Jun 26 '13 at 21:54
@Reb.Cabin You are right. I'm not sure why it is so... – Kuba Jun 26 '13 at 22:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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