home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4355 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.5 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
  4. Subject: Re: How to distinguish between Click and Double-Click?
  5. Message-ID: <722@lax.lax.pe-nelson.com>
  6. Date: 18 Dec 92 18:43:58 GMT
  7. References: <1992Dec16.194809.19535@kth.se> <1992Dec18.012228.3908@hplabsz.hpl.hp.com>
  8. Sender: news@lax.pe-nelson.com
  9. Followup-To: comp.windows.ms.programmer
  10. Organization: PE-Nelson
  11. Lines: 37
  12.  
  13. In article <1992Dec18.012228.3908@hplabsz.hpl.hp.com>, yefchak@hplabsz.hpl.hp.com (George Yefchak) writes:
  14. |> Are the second opinions on that?  I think I've seen software
  15. |> which does seem to be able to distinguish between single
  16. |> and double clicks as described above.  (Actually, I've
  17. |> wanted to know how to do that too...)  In particular,
  18. |> on the Mac you have only one button, so this ability seems
  19. |> pretty important there.
  20.  
  21. The problem is that you will always get a WM_LBUTTONDOWN/WM_LBUTTONUP
  22. combination before getting the WM_LBUTTONDBLCLK message -- likewise for
  23. controls like a listbox you will always get the LBN_SELCHANGE before
  24. you get the LBN_DBLCLK notification.
  25.  
  26. The only way I can think to really distinguish between single and double
  27. clicks would be to set a timer when you get the first click and if you
  28. _don't_ get a double click notification within some period of time then
  29. you assume it must have been a single click and only then take the
  30. appropriate action for a single click.
  31.  
  32. Just thinking about trying to make this work properly for all cases and 
  33. users makes me feel slightly nauseated though.  A double click should
  34. only perform an action that is an extension of whatever a single click
  35. does, anything else would be confusing and cause endless annoyance.  I'm
  36. not a Mac user, but I'll bet that even there it is a very rare case where
  37. a double click does something completely unrelated to a single click.
  38.  
  39. I think the suggestion that modifier keys (CTRL, ALT, SHIFT) be used to
  40. distinguish between different actions on a click is the best way to go
  41. unless you want to introduce "mouse modes" in your application where the
  42. current mode determines the action of a click.
  43.  
  44.  
  45. ----------------------------------------------------------------------------
  46. Tom Brown               |  "She turned me into a newt...
  47. PE Nelson Systems       |                                  ... I got better"
  48. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  49. ----------------------------------------------------------------------------
  50.