Skip to main content
MCadu
Associate II
Mar 14, 2019 3:46 PM UTC
Question

How do I move elements within a scroll list without a touch screen?

I'm new to C++ and I've been reading about the buttoncontroller and keysampler but how do I move on element in the scroll list up or down upon a button pressed event?

This topic has been closed for replies.

1 reply

cameronf
Associate
Mar 14, 2019 5:16 PM UTC

You can use the animateToItem method defined in ScrollBase to manually move to a given item in your list.

virtual void animateToItem(int16_t itemIndex, int16_t animationSteps = -1);

So you can keep track of your current item index and increment/decrement it with your button presses.