A question about input logic - single and double click

Not sure if this is the right section, but I have a question about input logic. Here’s the thing. Let’s say a single left-mouse-click call functionA, and double-left-mouse-click calls functionB. Problem in practice is a double-left-mouse-click will call functionA as well. Unless there’s some kind of check after every single-click to make sure there isnt a follow up second click before calling functionA. But then that would mean a small delay every time functionA is called after a single-click. So my question is, is it possible to have a double-left-mouse-click without ever call functionA and have a very responsive single click?

Anyone have experience with issue like this? any idea?

It’s not a code issue, it’s a design issue.

Check out something that you’d typically double-click. An icon on your desktop is a great example.

The first click calls the first function all the time. The second click does something additional if it was performed within a certain time of the previous click on the same object. Note that it’s “something additional”, not “something else”.

With the desktop icon example, a single click selects an icon. In a double click, the icon is selected and then opened, and the selection still happens on the first click. The opening is additional functionality, and it’s not incompatible with the selection (in fact, the selection is a supporting action, which is good design from every point of view).

If you want to have incompatibly different functionality based solely on the timing of the clicks then yes, you’re going to need to wait until the latest moment that the input could be received to decide whether or not it happened. (This isn’t actually that uncommon in touch interfaces where different actions are performed on tap and double-tap inputs. There’s simply no way to know if a tap is a double-tap until the second tap has had time to not happen.) I’d question your underlying design there and try to find an alternate solution. Will users expect completely different functionality? Will users know to double-tap? Will the error rate increase? How can you do this differently? This might already be the best solution, but it might not, so think it over.

Thanks for the respond and the very clear explanation. I very much agree with you there. I cant think of an example that use both single and double-click for two entirely different functionality on the same object.

The reason I’m asking is that I have an input solution on the AssetStore which fire event for various input gesture/sequence. And a user has complaint about how some inputs always overlapped with each other. ie. double tap event can only be triggered after a single tap event and so on. Personally I think it’s very much an issue that the application designer has to deal with. But I want to make sure if there’s any better alternative out there from people with more experience in this regard.

Thanks again!

The only way to solve that is to delay the single-click until you know whether or not it’s a double-click. This introduces some lag into the interface, and is incredibly frustrating for the user. (I know, because we did it this way in our application, and it sucks.)

At any rate, that’s something the developer will have to deal with, because you don’t want your framework to have that problem.

Couldnt agree more, having a sluggish input is one of the worst thing ever.

Very few games use a double click now. Most rely on left or right clicks to do things.

Left click just selects right click can give an order to what is selected like move here or attack this object.

You can use a double left click approach in some situations like say inventory screens where you can control the UI and input based on predefined events. Like someone left clicks over an item slot and if they click a second time within 1 second you open up the properties of the items slot IF there is an item in that slot. So if they click the left mouse button twice with a delay between the clicks of no more than 1 second apart, are currently hovering over an item slot that is not empty, than you bring up the property window and load in the property data of the item in the item slot.

Simple…

Actually, since it’s something that the framework could make configurable pretty easily I’d suggest doing that. As I said, it’s a design problem - so put the control in the designer’s hands. If the designer doesn’t want double-tap events to have single-tap events beforehand then give the single-tap event an option that waits for a second tap and only fires if one isn’t detected.

The other complaints in the linked post I can’t speak to, as I’ve no idea about either what he’s doing or how the framework is meant to handle things.

A good suggestion indeed! I’ll look into the possibility.

Again, thanks all for your valuable opinion.