Arkadiy_Kolomiets
Topic Author
Posts: 9
Joined: 16 Jun 2024, 07:45

Multi-cursor and Multi-touch support

27 Aug 2024, 15:48

The system I'm working on has 2 independent joysticks each of them has its cursor and they can move it around the screen separately, so I'd like to clarify:
Does the platform support multi-cursor? If so, how can I achieve it?

If not, I see that there is support for Multi-touch, what API to use in C++?
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multi-cursor and Multi-touch support

28 Aug 2024, 12:20

You can implement multi-cursor using the multi-touch architecture. But you will need to render the cursor yourself.

From the point of view of the integration, you have the following view methods to inject multi-touch events:
virtual bool TouchDown(int x, int y, uint64_t id) = 0;
virtual bool TouchMove(int x, int y, uint64_t id) = 0;
virtual bool TouchUp(int x, int y, uint64_t id) = 0;
For using these events in the framework you can follow the Touch and Manipulation Tutorial.

I hope this helps.
 
Arkadiy_Kolomiets
Topic Author
Posts: 9
Joined: 16 Jun 2024, 07:45

Re: Multi-cursor and Multi-touch support

28 Aug 2024, 16:06

Our scenario is using same View for 2 cursors.

Looking at the mentioned TouchMove API:
    /// Notifies that a finger moved on the screen. Origin is in the upper-left corner.
    /// Returns true if event was handled
    virtual bool TouchMove(int x, int y, uint64_t id) = 0;
Just to ensure i understand correctly, to distinguish between cursors, i will pass for first cursor id = 0 & for second id = 1 ?

Just to ensure this behaves correctly, if there are several buttons on screen, and one cursor is hovering some button & the second cursor is hovering another button,
BOTH buttons will have "over effect" (on same frame), am I correct ?
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multi-cursor and Multi-touch support

29 Aug 2024, 11:11

Just to ensure i understand correctly, to distinguish between cursors, i will pass for first cursor id = 0 & for second id = 1 ?
Yes, exactly.
Just to ensure this behaves correctly, if there are several buttons on screen, and one cursor is hovering some button & the second cursor is hovering another button,
BOTH buttons will have "over effect" (on same frame), am I correct ?
Our default controls are designed for mouse input and support multi-touch through touch emulation. However, they may not behave as expected when they are simultaneously pressed. Please try it out and let me know if you encounter any issues. This will work for sure for any control you create that implement OnTouchDown, OnTouchMove, OnTouchUp, OnTouchEnter and OnTouchLeave.

Who is online

Users browsing this forum: No registered users and 2 guests