From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Separating Click from Shift-Click ?

I'm trying to separate click events (both left and right) from shift-click, ctrl-click and
shift-ctrl-click. This for a graph that has zooming enabled.
When I'm in the callback function in VAL_LEFT_CLICK, how can I know if shift or Ctrl is pressed ?
I looked at the various keyboard functions and code samples but they all seem to assume that
another key is pressed (they respond to EVENT_KEYPRESS events). The callback data doesn't contain
info on keys...
--
Guillaume Dargaud
http://www.gdargaud.net/
"The problem with computers is they do what you tell them." - Attribution unknown.
0 Kudos
Message 1 of 3
(2,619 Views)
Look at the sample project ..\samples\userint\moustate.prj that ships with CVI. It calls GetGlobalMouseState (defined in userint.h) in a timer callback to check VAL_SHIFT_MODIFIER (shift) and VAL_MENUKEY_MODIFIER (Control), but you could call it on a CLICK event.
0 Kudos
Message 2 of 3
(2,619 Views)
> GetGlobalMouseState
Thanks.
I thought I'd searched all the functions with mouse in their name... Not so !


BTW: I'm just trying out CVI 7.0: why does the source code browser window disappear each time I
double click on some of its content ? It's annoying.
--
Guillaume Dargaud
http://www.gdargaud.net/
C /n./: A programming language that is sort of like Pascal except more like assembly except that
it isn't very much like either one, or anything else. It is either the best language available to
the art today, or it isn't.
- Ray Simard.
0 Kudos
Message 3 of 3
(2,619 Views)