Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double Click vs Single Click - are these mutually exclusive

Can anyone name an instance of an application where clicking an entity (say image) does one thing, but if you double-click it it does something different?

The only example I've been able to find is in double-clicking a track in iTunes but then that selects it (single click function) and then plays it (double-click function) which implies (logically) that double click is the superset (containing single-click).

Basically, I am being asked to implement (in WPF) an image single-click doing one thing and an image double-click doing another thing and I'm not sure if this is even conceptually correct.

If someone has an example of anyone sensibly doing this that would be appreciated?

like image 547
Duncan Edwards Avatar asked Jun 09 '09 15:06

Duncan Edwards


5 Answers

From a Windows messaging perspective, a double-click always generates a single click message first; Windows can't predict ahead of time that another click will come in time to turn it into a double-click. I can't imagine that WPF is going to hide this physical fact from you.

like image 190
Mark Ransom Avatar answered Oct 28 '22 08:10

Mark Ransom


In answer to the direct question: Double Click vs Single Click - are these mutually exclusive? The answer is no, these are not mutually exclusive due to the manner in which Windows needs to interpret your behaviour with the mouse.

However, in answer to the more vague question regarding a precedent where a double click does not include the behaviour of single click [i.e. The two events exhibit mutually exclusive behaviour], there are some specific events in Windows that appear to exhibit the behaviour you're asking about.

For instance - the taskbar applets:

  • Single click usually opens a shortcut menu for that item.
  • Double click usually opens the properties menu for the application which that task bar item is linked to without opening the shortcut menu.

The taskbar clock:

  • Single click does nothing.
  • Double click opens the Date and Time properties.

You may notice however that it takes a moment to respond to your request and as others have noted that pause is Windows waiting to see if you're going to double click. If you don't double click then the Click behaviour is fired. If you do double click then the DoubleClick behaviour is fired. In these specific situations it was deemed suitable to have mutually exclusive behaviour and there may be some others.

I think it really depends on the situation as to whether the different behaviour is "right" or "wrong" - I don't think you can equivocably say that one is right and the other wrong in all situations. If the behaviour you are looking to exhibit makes good logical sense from a user perspective [not from your own programmer perspective], then sure, make the behaviour mutually exclusive; if however it doesn't make good logical sense to the user then avoid it.

like image 23
BenAlabaster Avatar answered Oct 28 '22 08:10

BenAlabaster


It's generally a bad pattern to make a double click do something unrelated to the single click behavior. In order to distinguish between the single click and the double click, you have to wait for a moment to see if the second click arrives. That can cause a disconcerting delay when you're just single-clicking something.

Raymond Chen has a good blog post on this issue, including how to do it.

But I'd push back on the designer first.

like image 44
Adrian McCarthy Avatar answered Oct 28 '22 10:10

Adrian McCarthy


The most obvious would seem to be Finder/Explorer, where single-clicking a file selects it and double-clicking opens it. There's plenty of precedent for this sort of thing, and people are well trained by its inclusion in the OS level to expect double click to do different things.

  • Text selection (in just about every app in existence) - single click to place the cursor, double click to select the word, triple click to select the whole line.
  • Explorer / Finder - single click to select a file, double click to open it.
  • Outlook - single click to preview an e-mail, double click to open in a new window.
like image 1
ceejayoz Avatar answered Oct 28 '22 09:10

ceejayoz


In Cooliris, if you click a cell in the wall, it gets selected. If you double click the image, it transitions to a full screen slide show mode, starting at that image.

like image 1
i_am_jorf Avatar answered Oct 28 '22 08:10

i_am_jorf