LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect control-mouseclick event

Solved!
Go to solution

I'm trying to make the Z-scale max property of an Intensity graph more flexible to modify from the front panel.  In the attached VI, I use an increment/decrement control and just detect a value change event (ignoring the value of the control).  This works fine, although it is a bit of a kludge.

 

I'd like to make it more functional though.  My main question is the following:  How can I detect a "control-mouseclick" event?  I plan to use this event to change the Intensity Graph max by a factor rather than by an additive value.

 

A second small question:  On the numeric control, is there a way I can get rid of the displayed number whitespace and leave only the increment/decrement buttons?

 

Thanks,

 

Allan

Download All
0 Kudos
Message 1 of 7
(8,490 Views)

Create a Mouse Down event case.  Inside the case, unbundle PlatMods and get the value of Ctrl.  This value will be True if the control button was held down while the mouse was clicked.  See below:

 

Example_VI.png

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 7
(8,477 Views)

Sorry, let me be a little clearer:  By "control-mouseclick", I mean pressing on the increment/decrement buttons with the mouse while holding the control key down. Whether the event is detected as a mouseclick or a value change doesn't particularly matter to me.

0 Kudos
Message 3 of 7
(8,476 Views)

Thanks...just saw your reply after I posted my clarification.  I'll take a look and try it out.

0 Kudos
Message 4 of 7
(8,475 Views)

Just pretend that the Stop button in my example is an increment or decrement button.  It will work the same way.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 7
(8,461 Views)

tbob,

Thanks.  Your suggesetion solves my original problem, but it creates another.  With the platmods "ctrl" boolean hooked to a case statement, I can choose between those "ctrl click" and "regular click" cases.  However, with the "mouse down" event, I can't tell if the increment or decrement button was pressed.

 

I guess one solution is to replace a single inc/dec control with two booleans controls (increase and decrease) and to have two separate events .  Problem with that is that I'm really piling up event cases, because I'll need several copies of this type of control on my front panel.

 

Can you suggest any way to have both inc/dec button and ctrl-mouse functionality?  Maybe there is a way to combine the "value change" and "mouse down" events?

 

Allan

0 Kudos
Message 6 of 7
(8,447 Views)
Solution
Accepted by bracker

Are you talking about the inc/dec button on a numeric control?  I thought you had separate booleans for increment and decrement. This is tough.  You can't get the PlatMods when using a Value Change event.  You may have to make your own inc/dec controls and update a numeric indicator instead of using a numeric control.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 7
(8,414 Views)