From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture right mouse click in image

I would like to capture a right mouse click while pointing into am image window.
So far I've come only to the possibilty to capture events that originate somehow with the left mouse click.
Or
Are specific to the front panel of the currently active VI
Or
Detect whether at the time of calling a subVI the button is down or up, with all the usual hazzel of detecting the transition (plus the necessity of depending on MS Driect X).

What I would like to have is a signal that describes the right click in an image window.

Thanks for any ideas
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 1 of 8
(3,609 Views)
I LabVIEW 6.1 and up, you can use the event structure to capture mouse clicks. On the left side of the event structure is a nice little box that includes an input called "Button" this input is the button number that was pressed. You can catch all clicks with whatever button this way and perform various operations based on the button. This is probably the easiest way to check.

Rob
0 Kudos
Message 2 of 8
(3,609 Views)
Hi,

If you use LV7, you can use the event structure. Add an event or filter
event "Mouse down" for the picture. The "button" value indicates 2 for the
right button, 1 for the left.

Regards,

Wiebe.


the picture control has a property "Mouse". This is a cluster, that includes
"Gabriela Tillmann" wrote in message
news:5065000000080000005DC20000-1077587809000@exchange.ni.com...
> I would like to capture a right mouse click while pointing into am
> image window.
> So far I've come only to the possibilty to capture events that
> originate somehow with the left mouse click.
> Or
> Are specific to the front panel of the currently active VI
> Or
> Detect whether at the time of calling a subVI the button is down or
> up, with all the usual hazzel of det
ecting the transition (plus the
> necessity of depending on MS Driect X).
>
> What I would like to have is a signal that describes the right click
> in an image window.
>
> Thanks for any ideas
> Gabi
0 Kudos
Message 3 of 8
(3,609 Views)
Obviously i was not explicit enough in describing the problem. Event structures work on VI's only (as far as I know). It may even be possible to set it up to detect an event on an external (not your own) frontpanel. BUT NOT on a associated sub window such as an IMAQ image (not a picture on the frontpanel).
And the IMAQ Event does not discern left and right click.
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 4 of 8
(3,609 Views)
Obviously i was not explicit enough in describing the problem. Event structures work on VI's only (as far as I know). It may even be possible to set it up to detect an event on an external (not your own) frontpanel. BUT NOT on a associated sub window such as an IMAQ image (not a picture on the frontpanel).
And the IMAQ Event does not discern left and right click.
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 5 of 8
(3,609 Views)
Gabriela,

The event structure can be used for controls. You are probably right, it
cannot be used for an IMAQ image. You can however convert the IMAQ image to
a picture, and use the picture control to catch the events. This might be
less convenient in some cases...

Hope it helps,

Wiebe.

"Gabriela Tillmann" wrote in message
news:50650000000500000071610100-1077587809000@exchange.ni.com...
> Obviously i was not explicit enough in describing the problem. Event
> structures work on VI's only (as far as I know). It may even be
> possible to set it up to detect an event on an external (not your own)
> frontpanel. BUT NOT on a associated sub window such as an IMAQ image
> (not a picture on the frontpanel).
> And the IMAQ Event does not d
iscern left and right click.
> Gabi
0 Kudos
Message 6 of 8
(3,609 Views)
G Toolbox -> Keyboard & mouse event.vi works for non-VI windows,
as long as in same process.


Gabriela Tillmann wrote:
> Obviously i was not explicit enough in describing the problem. Event
> structures work on VI's only (as far as I know). It may even be
> possible to set it up to detect an event on an external (not your own)
> frontpanel. BUT NOT on a associated sub window such as an IMAQ image
> (not a picture on the frontpanel).
> And the IMAQ Event does not discern left and right click.
> Gabi
0 Kudos
Message 7 of 8
(3,609 Views)

I know this is an old thread, but...

 

If the button value is zero, it is the left mouse button.

If the button value is one, it is the right mouse button.

 

Bye.

0 Kudos
Message 8 of 8
(2,687 Views)