This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Event handling in Matrix gui application

Hi,

I am working on AM335x starter kit and it is provided with linux sdk having matrix gui application.  When we touch any icon it is processing to the sub menu written in code. But i want to know how they are handling these touch events.

Can anyone help me how these touch events are handled in this application? Or any related document

Regards,

Sowmya

  • Hi Sowmya,

    The Matrix uses /dev/input/touchscreen0 as input. Please check the /etc/init.d/matrix-gui-2.0 file for configuration.

    I'm not able to help you with details, but as far as I know a daemon is running in the background and it reads the touch events. Then, based on the knowledge about the icons position in the HTML5 browser, it launches the corresponding application. Please check these files where this is done:

    <sdk_dir>/example-applications/matrix-gui-2.0/submenu.php - calling run_script.php when an application is detected
    <sdk_dir>/example-applications/matrix-gui-2.0/run_script.php - executing the application using execute_command.sh, located in the same folder

    Best regards,
    Miroslav

  • Hi Miroslav,

    Thank you for the reply.

    The script file in /etc/init.d/matrix-gui-2.0 uses touch screen and as far as I understood is , on booting and starting matrix application , it is calibrating the touch screen.

    Since Daemon in running in the background, can't we trace the touch event?

    Since I'm new to linux, please help me.

    Regards,

    Sowmya

  • Sowmya, you can read the touch events in a few different ways.

    You can use the evtest tool to read events from /dev/input/touchscreen0. Example:

    evtest /dev/input/touchscreen0

    You can also use the ts_print or ts_print_raw tools to do almost the same.

    Best regards,
    Miroslav

  • Yes I verified the touch event position using "evtest" and "ts_print " command but I wanted to know how matrix-gui is handling these events.

    You told Daemon is running in background for handling touch events.                                                                           Thank you Miroslav for the reply.

    Regards,

    Sowmya