How to distinguish Double-click and Single-Click event?

How to distinguish Double-click and Single-Click event?

Post by damay » Wed, 12 Dec 2007 10:55:44

Dear all
I made a figure and set 'ButtonDownFcn' to a subroutine named
'SaveData2File'. Below is SaveData2File code.

function SaveData2File(FigHandle, evnt)
SelType = get(FigHandle, 'SelectionType');
if strcmpi(SelType, 'Open')
% do something when I press double-click
return;
elseif strcmpi(SelType, 'alt')
% do something when I press right-click
return;
end

However, when I press double-click, SelType is always 'normal' but not
'open' that I want. I think when pressing double-click, MATLAB first
recognized single-click, so 'SelectionType' is always 'normal'. How
can I make double-click event and let MATLAB recognize it?

Any comments or advice will be my pleasure.

Best Regards
damayi
2007-12-11

 
 
 

1. Why does my event structure run a single click when I double-click?

2. How can I distinguish between a Click and a double click event in an UserControl

Hi All,

I have a control derived from UserControl. Now I would like to
distinguish between a click and a double click event on my control. The
problem is, that on a doubleclick, the control raises the click and the
double click event. According to the documentation, that is the default
behavior.

I tried to change that by setting using Control.SetStyle with
StandardClick and StandardDoubleClick(in every combination), but the
best thing that I did achieve, was to turn of all click events :-(

As other controls are handling this differently, I'm pretty sure that
there is a way to do it.

Any hint would be appreciated.

Thanks in advance,
Andy




--
To mail me directly, remove the NO*SPAM parts in
NO* XXXX@XXXXX.COM *SPAM

3. Double-click, Single-click Mouse Setting

4. Single-click acts like double-click

5. How to Detect Double-Click & Single-Click

6. single-click in Explorer, double-click in dialogs?

7. single-click double-click XP registry problem

8. single-click or double-click to open a file??

9. double-click to single-click

10. Single-click becomes Double-click

11. Single-click acts like Double-click

12. No Double-Click event fired for a ListView when I double click.

13. How to capture Mouse Single click and mouse double click event

14. Single Click/Double Click Missing Mouse Clicks

15. Single-clicking _sometimes_ produces double-click in IE8