Skip to main content
GB.1
Associate
Question

Scroll Menu container with hardware keys

Hi there, i'm really new to touchgfx and stm32 ecosystem and working on a project with multiple screens, were all has to be controlled with hardware buttons, the polling function for the buttons it's already implemented in a separate task and working (i can change screen back and forth using touchgfx interaction), but i'm really stuck on how to use the buttons to scroll and then select items on the container (container already implemented and showing the correct elements and it works using touchscreen on a 32F746G DISCO board). Any suggestion? Just as a notice i'm really ok in C programming but still learning C++

Thank you very much, Best Regards.

This topic has been closed for replies.

3 replies

ktrofimo
Senior III

Look similar topic here: ​https://community.st.com/s/question/0D53W00000rZDA3SAO/how-to-emulate-touchgfx-touch-input-using-hardware-buttons-especially-in-scroll-list

MM..1
Super User

Some example

void Screen4View::curup() {
 
	scrollList1.itemChanged(cursorpos);
 
	if (cursorpos > 0) {
		cursorpos--;
	} else {
		cursorpos = scrollList1.getNumberOfItems() - 1;
		scroll_flag = true;
	}
	scrollList1.animateToItem(cursorpos, 50);
	scrollList1.itemChanged(cursorpos);
	scrollList1.invalidate();
}

GB.1
GB.1Author
Associate

Thank you very much.