LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Any way to detect key press on mouse click?

Hi experts,
 
Graph zoom uses mouse click left and right with <Ctrl> held down.  This happens without a callback on the graph.
 
I'd like to use mouse click left and right without <Ctrl> to do some custom things by having a callback on the graph.
 
But using the zoom feature with <Ctrl> not only zooms but does the callback.
 
Is there a way for me to detect the <Ctrl> key held down when I get my mouse click in the callback so my custom features don't conflict with zoom?
 
The only reference to looking at keys I can find in the documentation is EVENT_KEYPRESS, and you don't get that for <Ctrl> and it's not a key press anyway.
 
Thanks in advance.
 
Dave
0 Kudos
Message 1 of 3
(3,375 Views)
A call to GetGlobalMouseState() or GetRelativeMouseState() in your callback will tell you the state of the <Ctrl>, <Shift> and <Alt> keys. Strange but true.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 3
(3,359 Views)

Indeed it does.  Thanks Martin.

I love using CVI, but one of the problems is it has so many features and there are not enough keywords for to get the answers you want.  I tried many different ways to find this, but I just didn't pick the right words.  And of course, the answer was in an obvious place.

Dave

0 Kudos
Message 3 of 3
(3,354 Views)