02-27-2008 01:56 PM
02-27-2008 02:14 PM
Within your control callback, examine the value of keyModifiers. From the control help in the function panel:int GetGlobalMouseState (int *panelHandle, int *xCoordinate, int *yCoordinate, int *leftButtonDown, int *rightButtonDown, int *keyModifiers);
"State of the keyboard modifiers, in other words, the <Ctrl> and <Shift> keys.Regards,
If no keys are down, the value is 0. Otherwise, the value is the bitwise OR of the appropriate key masks: VAL_MENUKEY_MODIFIER and VAL_SHIFT_MODIFIER.
You can pass NULL."
02-29-2008 01:44 PM
Thank you. I would never have had the idea to look at the mouse state to get the modifier key.
Bertrand
08-24-2015 10:43 PM
Please Help me out this.
in my application i did two button UP and DOWN.
if i press UP button my object will move up direction same if i press DOWN my object will move down.
here i want i will press continues UP button my object will move contuesly,i tired alot is it possible in cvi 5.5.
08-25-2015 01:57 AM
Hello,
Maybe something like that should work.
int CVICALLBACK ButtonUp (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{int LeftBtDown;
switch (event)
{
case EVENT_LEFT_CLICK:
LeftBtDown = 1;
while (LeftBtDown==1)
{
/*==== Move Object ===*/
// Code for moving object
GetRelativeMouseState (panelHandle, 0, 0, 0, &LeftBtDown, NULL, NULL);
}
break;
}
return 0;
}
08-25-2015 02:03 AM - edited 08-25-2015 02:05 AM
okay thank you i will try this
08-25-2015 09:20 PM
thak you sir its working
08-31-2015 01:18 AM
Hello Sir,
this code working fine with my machine,now machine will go up down w.r.t my up/down key press, but my while loop causing prob if im using up or down button my othr funtion not updating,in my code evry .001 sec my one function running....if im using up/down button my other function not executing parrally.....
how to solve this ...shall i use timer intsted of while?.
Thank you in Advance
sudhir