MOUSE DOUBLE CLICK PROBLEM

11 views (last 30 days)
VERTIKA PATHAK
VERTIKA PATHAK on 11 Feb 2021
Commented: Bjorn Gustavsson on 11 Feb 2021
The script Im using has an option to accept the double click as the answer and move to next question. However, matlab does not accept my double click (IM USING TRACKPAD NOT A MOUSE). I am a mac user with OS catalina 10.15. Has anyone faced the same issue, any help would be appreciated!
  2 Comments
Geoff Hayes
Geoff Hayes on 11 Feb 2021
Vertika - can you show us the code that you are using to accept a double-click? This example (from https://www.mathworks.com/matlabcentral/answers/96424-how-can-i-execute-a-double-click-callback-without-executing-the-single-click-callback-in-my-matlab-g) works as expected on my Mac via a double-click of the trackpad
function example
close all
set(gcf,'WindowbuttonDownFcn',@clickcallback)
function clickcallback(obj,evt)
switch get(obj,'SelectionType')
case 'normal'
case 'open'
disp('double click')
end
Bjorn Gustavsson
Bjorn Gustavsson on 11 Feb 2021
The other, "accepted", answer on that link might be better suited to handle both a single-click and a double-click event, that might be what the OP looked for (and if it is it is the solution to my problem!)...

Sign in to comment.

Answers (1)

Bjorn Gustavsson
Bjorn Gustavsson on 11 Feb 2021
Once I wrote an image-processing tool where I wanted to use all 4 mouse-button events - but it seemed as if the double-click event always triggered the a single-click event first, and then a double-click event. For my case that was possible to deal with (the response to the single-click did not noticeably change the response to the double-click). This was a couple of years ago, so this might have changed. You could try to write the most basic event-handling function and check what it does to the different events - something like just echo a number for each event. That might tell you how this is handled on your system.
HTH

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!