LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i get the the mouse leftkey-pressed event?

i want to get the event of the mouse leftkey-pressed. how do i get it?
thanks.
0 Kudos
Message 1 of 7
(3,922 Views)
Open your uir file.Then go to code\preferences\Defaultcontrolevents in the toolbar for selecting all the events you need.
In case of panel events you go to code\preferences\Defaultpanelevents. Then set the target file at code\settargetfile and generate code at code\generatecode\controlcallbacks in case you are using EVENT_LEFT_CLICK for some control.for any other information regarding the event callbacks go to labwindows/CVI help and search for the keyword.
0 Kudos
Message 2 of 7
(3,922 Views)
The CVI event is EVENT_LEFT_CLICK. In the callback for the control or panel for which you want to check, add a case for EVENT_LEFT_CLICK. For example,

int CVICALLBACK OkCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
// do something
break;
case EVENT_LEFT_CLICK:
// do something else
break;
}
return 0;
}
0 Kudos
Message 3 of 7
(3,922 Views)
Use the UIR editor menu Code >> Preferences >> default events if you want the code generator to automatically add EVENT_LEFT_CLICK as a case for every function it generates. If you want to add it on a case-by-case basis, you can just add the case EVENT_LEFT_CLICK manually.
0 Kudos
Message 4 of 7
(3,922 Views)
i mean that i want to get the event of the mouse leftkey-pressed. it is not
the 'left-click' event. the event is just appearing when the leftkey is
pressed . the click event is composed two components which are the
key-pressed and the key-up. i just get the key-pressed event
"ÐÄÒâÎÞÑÄ" дÈëÏûÏ¢ÐÂÎÅ:4118e1d6@newsgroups....
> i want to get the event of the mouse leftkey-pressed. how do i get it?
> thanks.
>
>
0 Kudos
Message 5 of 7
(3,922 Views)
For more control over the mouse events, you can use the EnableExtendedMouseEvents() function in the programmers toolbox. Here is the snippet of the help for that function

This function enables a control to receive the following extended mouse events in addition to the usual mouse events.
EVENT_MOUSE_MOVE
EVENT_LEFT_MOUSE_UP
EVENT_RIGHT_MOUSE_UP


The built�in CVI mouse events are:
EVENT_LEFT_CLICK
EVENT_LEFT_DOUBLE_CLICK
EVENT_RIGHT_CLICK
EVENT_RIGHT_DOUBLE_CLICK
each of which occur when the mouse button is pressed down.


Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 6 of 7
(3,922 Views)
I think you can do this using timers.I have attached a simple project which uses timer.Just take a look at the attachment.
0 Kudos
Message 7 of 7
(3,922 Views)