Applies To:
  • CitectSCADA 5.31, 5.40, 5.41, 5.42, 5.50, 6.0, 6.1, 7.0
  • CitectHMI 5.31, 5.40, 5.41, 5.42, 5.50, 6.0, 6.1, 7.0
  • CitectFacilities 5.31, 5.40, 5.41, 5.42, 5.50, 6.0, 6.1, 7.0
  • CitectSCADA Batch 5.31, 5.40, 5.41, 5.42, 5.50, 6.0, 6.1, 7.0
  • CitectSCADA Pocket 5.31, 5.40, 5.41, 5.42, 5.50, 6.0, 6.1, 7.0

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:


- In runtime, if you click on the text object on the left hand side, it will switch from "available" to "running", and then to "stopped", and finally back to "available".

- 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).
Once this number of ms has expired, you test the value, and perform the required action.


This is the easisest and most stable solution I have found. You can actually configure a double-left click event in the keyboard commands as well. However, a double-click is a double single-click, so the single click event would also be fired twice, which is not desirable behaviour. 


Keywords: