Skip to main content
GB.1
Associate
June 15, 2021
Question

Scroll Menu container with hardware keys

  • June 15, 2021
  • 3 replies
  • 1030 views

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
June 15, 2021

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
June 15, 2021

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
June 18, 2021

Thank you very much.