3 ms·
This reminds me a bit of how double-click works, or originally worked: A single (first) click selects the element, and if there’s a second click within a short
by layer8 3y ago
This reminds me a bit of how double-click works, or originally worked: A single (first) click selects the element, and if there’s a second click within a short timeout period on the selected element, it invokes a default action on that element. Meaning, the double click is not a separate type of operation, it’s a continuation of what happens on a single click. You don’t wait after a single click to see if it becomes a double click; instead you always perform the single-click operation (selecting the element), and a second click that makes it a double click may or may not follow, and if it follows is compatible with the single-click action.
- PaulDavisThe1st 3y agoHistorically, it differed on different windowing systems. The two versions featured the following event sequences: A: button press, button release, button press, button release B: button press, button press, button release This subtle difference leads to a world of difference in mid-level code.
- layer8 3y agoYes. However, if you select on the first button press (which I think is the usual behavior?), then it shouldn’t matter if you get a corresponding button release or not. Option B allows to implement an “incompatible” single-click action, with the trade-off that it must be bound to the button release, not the (first) button press.