12-26-2012 07:32 AM
This may not be a LabVIEW problem, but maybe somebody knows a workaround.
LV 2010.0
I have a text ring, populated with only one item.
I intercept the MOUSE DOWN? event on this control.
Upon that event, I look at the MODIFIER keys (Shift, Ctrl, Alt) and populate the control's menu (STRINGS & VALUES) according to which key(if any) is pressed.
(The point is to offer channels in alphabetical order, or in order of units, or in order of hardware type, etc...)
After populating the menu, the menu pops up and the user sees the list rearranged in whichever fashion.
The user chooses one, and the VALUE CHANGED event triggers removal of the full menu and insertion of the single chosen item.
This worked fine..... until I moved to Win 7.
Now, when I try the ALT option - the menu just flashes and then disappears. The first time you ALT-click, it appears for maybe 0.3-0.5 second and then drops. Subsequent times it just draws the frame and then drops - it's just a blip - maybe 0.1 second.
Clicking on it without ALT works normally, and then the next ALT click will restore the long (0.3-0.5 sec) behavior.
If you release the ALT key during that 0.3-0.5 seconds, the menu sticks and works OK, but that's not something people are expecting to do.
It's not my code at fault: try this yourself:
Place a TEXT ring or a MENU ring on a new panel.
Enter "A", "B", "C" as your items.
without even running the VI, Alt - click on the thing.
In Win 7, it flashes the menu, then takes it away.
I've looked for some Easy Access feature that was turned on by mistake - Mouse Keys, Sticky Keys, Toggle Keys, Filter Keys, they're all OFF.
Is there a "don't be stupid" preference somewhere that I could turn on? Or do I have to switch to another key?
(I'm using ALt, Ctrl, Shift - maybe I could use the Win Key...)
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 08:06 AM
The CTRL-ALT combination works just fine.
The SHIFT-ALT combination does the SHORT flash every time - it does not do the 0.3-sec pause.
I don't use the CTRL-ALT-SHIFT combination - but it does the same as CTRL-ALT.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 08:12 AM
I tried modifying the PLATMODS that get passed out of the MOUSE DOWN? event. - No luck.
I thought maybe pretending the ALT key was not down would make a difference.
It doesn't.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 09:29 AM
In my program, or a little test program, if I DISCARD the MOUSE DOWN event, then the menu nevar appears.
That's sensible.
Obviously, it's paying attention to my event handler.
Why then, does it not pay attention to the fact that I change the PLATMODS structure so that the ALT key is NOT down?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 09:54 AM
The KEY DOWN? event no longer gets triggered by an ALT key press.
It's called for SHIFT, and for CTRL, but not ALT, with Win 7.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 11:22 AM
can you show us an example vi that demos the behavior your seeing?
12-26-2012 03:58 PM
Try the little test I suggested:
Place a TEXT ring or a MENU ring on a new panel.
Enter "A", "B", "C" as your items.
without even running the VI, Alt - click on the thing.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 04:11 PM
Attached is a VI which shows the SHIFT-ALT-CTRL states when the ring is clicked on.
Here is a JING which shows the behavior: http://www.screencast.com/t/2Xh5loKW
The JING doesn't capture every flash, as the flash is sometimes quick. But it shows some of them. It happens every time.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-26-2012 04:31 PM
That is odd
12-27-2012 09:33 AM
Does "disable the keyboard" work for you or not?