Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting mouse button and tool selection from IMAQ Image control

Hi,

I'm trying to get both the mouse button (right or left) and the tool type from an IMAQ Image Control event. However, as far as I know I can only get the mouse button using an event loop, and I can only get the tool type from the control's Get Last Event method. Using both the event loop and the method together doesn't work. Is there any way to do this?

Thanks!
0 Kudos
Message 1 of 6
(3,637 Views)

Hi Moof,

Though the 'Get last event' method does not display the tool type on the Mouse Down event, you should try using it with the Mouse Up event.  I was able to write a small program that, upon mouse up, displayed both the button pressed and the tool type.

Hope this helps,

Robert

0 Kudos
Message 2 of 6
(3,622 Views)
Could you upload your program? I couldn't get that to work.

Thanks!
0 Kudos
Message 3 of 6
(3,617 Views)
Hey Moof,
 
Here is the code I wrote.
 
 
Hope this helps,
 
Robert
0 Kudos
Message 4 of 6
(3,605 Views)
Hi,

Thanks for the code. However, if I right click on the display, Get Last Event doesn't work (returns "None" for the tool).

Thanks!
0 Kudos
Message 5 of 6
(3,602 Views)
Hi Moof,
 
No problem on the code.  In regards to not being able to select a tool when you right click, this is most likely due to the fact that the tool indicator comes from the 'get last event' invoke node.  This invoke node is associated with the picture control, and will only list events specific to the control.  When you right click on the image display, you can see that another window opens with options.  This does not generate an event on the display.
 
I have experimented with creating a property node from the image display, and using the node to display the selected tool.  I don't know if this is what you are looking for, but it may be the closest we can get.
 
Hope this helps,
 
Robert
0 Kudos
Message 6 of 6
(3,588 Views)