Simulator - Using key presses as inputs?
Hello,
I noticed there is a way to print to a console from the simulator using touchgfx_printf, I'm wondering if it's possible to read in characters also?
I noticed the comment in Utils.hpp:
The console window is used to print to using touchgfx_printf(), printf() or std::cout,
* and read from using e.g. fgets() or std::cin. Alternatively, instead of using
* printf(), simply use touchgfx_printf() which will ensure there is a console to write
* to. After the first call to touchgfx_printf(), it will also be possible to read from
* stdin.
This would be useful to replace parts of the code where I am waiting on a message queue, instead I could do the following, pseudocode:
if SIMULATOR
wait on character input x from console
do action based on key input
else
wait on OS message queue
do action based on message
My understanding is that FreeRTOS is not used for the simulator, so this would be a useful way to imitate other system tasks sending messages to the GUI. This would allow me to still use the simulator and keep the build simple.
If it is possible, then it would make a great addition to the already very good TouchGFX documentation.
Thanks in advance,
Anthony

