dbawel

Using 2 pointerdown events to trigger two seperate actions

Recommended Posts

Hello,

How do I use 2 canvas pointerdown events to trigger 2 seperate actions, as I just received the requirement at the last minute that two users had to use the touchscreen for the same event triggered by their seperate touch events. However, it appears that hand.js sends a pointerup event as soon as a second pointerdown event is triggered. Any thoughts? I\m quite worried now.

Also, I can't set regions for each pointer event - it must work on the entire touchscreen.

Thanks,

DB

 

Share this post


Link to post
Share on other sites

Hi @Deltakosh, I'm not certain how to set the IDs for each pointer event, and use tis in a function to have the same or seperate funtion controlled by a specific pointer ID. It's simply my lack of knowledge in identifying and using pointerID.

Thanks,

David

Share this post


Link to post
Share on other sites

Hello i read the question yesterday. Also from my side, i don't really understand what you are going for.

So their will be two players before a thouch screen, one have a red ball and the other will have a blue ball.
You can assign a event to those meshes. Make a callback.   

Share this post


Link to post
Share on other sites

@Nabroski, @Deltakosh, and all,

Thank you for loking at this. I guess I didn't describe well enough what the project requirements are. I have created a simulation of cells floating and colliding in a volume, and am creating a new collision object which must scale at intervals to reveal a message and also move around the screen to colide with the "cells" who obviously have imposters. So I'm using canvas event listeners for pointerdown and pointermove, and for pointerup the "void" collision object used to clear the small area for the message and moving around the screen is then disposed. But 2 persons at a minimum are required to use simultaniously. This is for a trade show in one week to be run on Chromium and a large screen where at east 2 people are permitted to use simultaniously.

I have almost everything built, except for multi-user interaction. As always, thank you for you help with this.

Cheers,

DB

Share this post


Link to post
Share on other sites

@Deltakosh and @Nabroski -

The issue is not related to BJS, but to several factors. One that I just learned that a pointerdown event is not held in the event listener for more than a few seconds unless a pointermove event is initiated. So my onpointerup function is not working correctly. Also, a second simultanious pointerdown event removes the first pointerdown event. The link to the scene is below:

qedsoft.com/DEMOS2014/PE_KYP/index23.html

I must find a way to capture all pointer events and apply then to my functions for at least 2 simultanious users. I've found examples of this using jQuery, but have been completely unsucessful in applying anything that works. I'm very interested in learning about pointerID, but can't locate any info that makes sense to apply.

Thanks,

DB

Share this post


Link to post
Share on other sites

The best starting point is this one: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events

In a nutshell, evey pointer events will come with a e.pointerId identifying the "finger".

 

So if two people touch the screen: you will receive two pointerdown where e.pointerId will be different. This pointerId will remain unchanged for each finger until the finger stops touching the screen

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.