Touchscreen inputs may be too transient to be captured by repetitively checking mouse status ?
2 views (last 30 days)
Show older comments
Hello, experts.
I'm using Psychtoolbox. I usually wait for and detect a mouse input like this:
while true
[x, y, button] = GetMouse ;
if any(button)
break
end
end
And it works fine with mouse. But when I run this with the touchscreen of Microsoft Surface, I often have to poke several times with my finger to input a click. The mouse works fine with my code on Surface, and the touchscreen works fine in all Windows applications on Surface except when running my code.
I doubt that it's because when I poke the touchscreen, the effect equals a very brief mouse click on that point. Sometimes the duration of the click includes the time when the function GetMouse runs, and a click would be received by my code. But sometimes the duration of the click doesn't include the time when the function GetMouse runs, so my code does not detect the click.
Is my guess correct? If not, what might the cause be? Could any of you experts please tell me how can I detect inputs on touchscreen sensitively? Thank you a lot if you help!
2 Comments
Chip
on 1 Mar 2018
I am having the same problem, but it is only a problem for the first touch. Subsequent touches seem to be detected on time and accurately. In fact, my program works fine if I "double" the first touch (but this is not an adequate solution). Did you find the solution to your problem, Bisconect?
Deepa Prabhu
on 20 Jun 2018
Hi, I am having the same problem. Appreciate any answers/workaround tips. Thanks in advance.
Accepted Answer
bisconect
on 21 Jun 2018
1 Comment
Deepa Prabhu
on 22 Jun 2018
Thanks for the tip. I ll also install Ubuntu and run Matlab then. Cheers,
More Answers (1)
Jan
on 2 Jun 2017
Using a callback of the underlying object will be a much better approach than a polling loop.
2 Comments
Jan
on 8 Jun 2017
Edited: Jan
on 8 Jun 2017
This seems to be a good question for a PsychToolbox forum.
What about using GetClicks instead? See also KbQueueCreate, which is thought exactly for this problem.
Note that I do not know the PsychToolbox and used just Google to find these suggestions.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!