MOUSE DOUBLE CLICK PROBLEM

13 ビュー (過去 30 日間)
VERTIKA PATHAK
VERTIKA PATHAK 2021 年 2 月 11 日
コメント済み: Bjorn Gustavsson 2021 年 2 月 11 日
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 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 2 月 11 日
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 2021 年 2 月 11 日
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!)...

サインインしてコメントする。

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 2 月 11 日
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

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by