Applies To: |
|
Summary: |
Im looking for an application sample that handles special event depending on mouse action, particularly a double-click action. |
Solution: |
You can configure a double-left click event in the keyboard commands. However, a double-click is a double single-click, so the single-click event would be fired twice (if you configured one), which may not be desirable behaviour. If you wish to implement a real double-click event, ie without triggering the single-click event, you may use the following logic: - each click on the button would increment an integer value. After some time (eg 300ms), the value would be reset to zero. But just before resetting the value to 0, we would test the INT value and run a function (in a new task) according to the INT value: 1 would be a single-click event 2 would be a double-click event
A test project is attached to this article.
Several things to note:
- The idea behind the cicode is that you basically increment an
internal INT every time you click on the rectangle ( within the
last xxx ms).
|
Keywords: |
Related Links