cancel
Showing results for 
Search instead for 
Did you mean: 

Does touchgfx support multi-touch?

Xu
Associate II

Hello, everyone.

Does touchgfx support multi-touch?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @Fanny XU​,

TouchGFX doesn't support multi touch. The TouchController interface is based on a single set of coordinates and whether a touch was registered or not.

/**
     * @fn virtual bool TouchController::sampleTouch(int32_t& x, int32_t& y) = 0;
     *
     * @brief Checks whether the touch screen is being touched, and if so, what coordinates.
     *
     *        Checks whether the touch screen is being touched, and if so, what coordinates.
     *
     * @param [out] x The x position of the touch
     * @param [out] y The y position of the touch
     *
     * @return True if a touch has been detected, otherwise false.
     */
    virtual bool sampleTouch(int32_t& x, int32_t& y) = 0;

If you have a touch controller IC that can do multi-touch you could probably imeplement these as special events and propagate them to your active views.

Best regards,

Martin

View solution in original post

5 REPLIES 5
Martin KJELDSEN
Chief III

Hi @Fanny XU​,

TouchGFX doesn't support multi touch. The TouchController interface is based on a single set of coordinates and whether a touch was registered or not.

/**
     * @fn virtual bool TouchController::sampleTouch(int32_t& x, int32_t& y) = 0;
     *
     * @brief Checks whether the touch screen is being touched, and if so, what coordinates.
     *
     *        Checks whether the touch screen is being touched, and if so, what coordinates.
     *
     * @param [out] x The x position of the touch
     * @param [out] y The y position of the touch
     *
     * @return True if a touch has been detected, otherwise false.
     */
    virtual bool sampleTouch(int32_t& x, int32_t& y) = 0;

If you have a touch controller IC that can do multi-touch you could probably imeplement these as special events and propagate them to your active views.

Best regards,

Martin

Xu
Associate II

Hi Martin

Thank you very much for your reply. ​And is it possible to have all widgets support multi-touch in the way you describe? For example, the zoom of a picture is operated by two fingers.

Martin KJELDSEN
Chief III

You would need to change the behavior of all widgets to support multi-touch, because the code written for them only understand click-, drag- or gestureEvents (limited to swipe). But this is entirely possible to do, to have a specialized version of the widgets you want to add multi-touch to. e.g. If you're looking to add zoom to a static image you could combine ScaleableImage (uses the texturemapper) with multi-touch. It would be an expensive widget.

/Martin

Xu
Associate II

OK,thank you for your answer.​

Martin KJELDSEN
Chief III

You're welcome!

/Martin