This may be an abuse of ListAnimate but I'm using it to flip through a bunch of images. When there are few enough images I can grab the slider with the mouse and flip back and forth among the images easily enough.
But when there are too many it's very tricky to flip through them one by one. Is there a way to simply use the arrow keys (or whatever keys) to flip forward and backward through the images, kind of like a slideshow?
Here's a simple keyboard controlled slideshow:
SlideShow[list_List] :=
With[{len = Length[list]}, DynamicModule[{pos = 1},
EventHandler[Dynamic[Pane[list[[pos]]]],
{"RightArrowKeyDown" :> (pos = Mod[pos + 1, len, 1]),
"LeftArrowKeyDown" :> (pos = Mod[pos - 1, len, 1]),
"UpArrowKeyDown" :> (pos = 1),
"DownArrowKeyDown" :> (pos = len)}]]]
Then you control the slideshow by selecting the output and using the arrow keys:
right=forward, left=back, up=first, down=last,
For example:
SlideShow[{"a","b","c","d"}]
Some example pictures:
pics = ExampleData /@ ExampleData["TestImage"][[{1, 2, 3, 4}]]
SlideShow@pics
(* Imagine a screen capture here *)
This can be dressed up to give it a frame, buttons, etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With