Touch queue and events explanation

Hello,

Could someone please explain or point me to an explanation of how different touch queue functions (Create, Release, Start, Stop) and touch event functions (Avail, Flush, Get) fit together?

Specifically, here’s a short version of an example experimental flow:

  1. Show general instructions and wait for participants to “press a confirmation button” on a touch screen.
  2. Start trials loop
    a) Show a trial instruction and wait for participants to press a confirmation button on the touch screen.
    b) Show a blank screen while participants have to do some other task (for some seconds).
    c) Show a response question and wait for participants to draw something on the screen.
    d) Show the drawing and wait for participants to press a confirmation button on the touch screen.

In this context, I’m currently creating and starting a queue outside the trials loop and stop and release it at the end of the experiment. During the trials loop I query for available touch events and get them. However, this results in irrelevant events being saved to the queue: for instance, during step 2b. What I actually want is that the queue is refreshed between each of the steps outlined above. I tried inserting TouchEventFlush call before querying for available events but that breaks everything (events are not being recorded at all).

What is the correct procedure here?

Thank you!

Try flushing before 2a so that any old events are gone, but any new ones during 2a will be available. Clear again after 2b and maybe after 2c too, depending on what you want exactly. Basically, flush out irrelevant stuff that may or may not be there for each new phase.

1 Like

What @dcnieho says. What model of touchscreen do you use? We are trying to build a list of models and setups that work well, see: Touchscreen that works with Linux?

@dcnieho Thanks. It works now.
But just to check my general understanding:

  • At the beginning of the experiment, I need to call TouchQueueCreate and TouchQueueStart
  • Whenever I need to do something with touch events, I keep checking for TouchEventAvail and fetch each one with TouchEventGet
  • Whenever I want to refresh the queue state, I call TouchEventFlush
  • At the end of the experiment, I need to call TouchQueueStop and TouchQueueRelease

Is this the general scheme of things?

@mariokleiner I’m using Dell 24 Touch Monitor - P2418HT. So far it’s working well with Linux (Ubuntu 20.04).

@katsangati, yeah that seems right. If you still have issues, try to post a minimal code version of what you are actually doing (cutting out irrelevant stuff), then we can have a look :slight_smile:

@katsangati thanks for the monitor info. Yes your workflow is right. We do have two demos for multitouch input which show the general workflow, MultiTouchMinimalDemo.m for the basics, MultiTouchDemo.m a bit more fancy. With “refreshing the queue state” i assume you mean discarding all touch input collected before that point in time. Ie. you use it at the beginning of a response period to make sure no “old” touches before the beginning of the response period get reported.