12-01-2008 05:50 AM
Hi,
I want to handle the ctrl+c option for a string control in labview. I just want to prevent the user from pressing the ctrl+c button for copying. is it possible to handle that inEvent Structure?
Thanks
Alagar
12-01-2008 07:22 AM
Hi Alagar,
can you describe what you try to do? You don´t get the key down event for "ctrl+c" but the key up. Maybe this is enough for you. Another solution could be to write a wrapper dll which hooks the key down event for you.
Hope it helps.
Mike
12-01-2008 07:47 AM
Alagar wrote:Hi,
I want to handle the ctrl+c option for a string control in labview. I just want to prevent the user from pressing the ctrl+c button for copying. is it possible to handle that inEvent Structure?
Thanks
Alagar
The simplest solution would edit the controls run-time pop-up menu and remove the ctrl-c as an option.
Does that help?
Ben
12-01-2008 08:40 AM - edited 12-01-2008 08:41 AM
Ben,
removing the entry Copy from the context menu is not sufficient. In order to disable the control to copy the current active selection, you have to disable <ctrl + c> as shortcut for copying data in the complete LabVIEW environment. You have to open the Tools >> Options, switch to Menu Shortcuts and browse to Edit >> Copy. Switch the shortcut to something else than <ctrl + c>. This will disable the copy function for the shortcut <ctrl + c> (it will occur with the new shortcut of course!)
Drawback:
a) You remove the ability to use <ctrl + c> from the whole LabVIEW environment. So also in edit mode of VIs....
b) When making a selection and then pressing <ctrl + c>, it will replace the selection with a simple 'c'. Most often, this is not intended.
So all in all, i would definetly NOT recommend anyone to alter the shortcuts for common functions defined by the OS (<ctrl + c> for Copy, <ctrl + n> for New Document, .... )
hope this helps,
Norbert
12-01-2008 09:03 AM
Good point Norbert.
Then in that case how about an event for "This VI" >>> Menu Selection ?
The Item Tag will indicate the type of operation.
Ben
12-01-2008 09:10 AM - edited 12-01-2008 09:10 AM
12-01-2008 09:13 AM - edited 12-01-2008 09:13 AM
Ben wrote:[...]
Then in that case how about an event for "This VI" >>> Menu Selection ?
[...]
That will do.
Norbert
PS: The item Tag would be "APP_COPY"
12-02-2008 08:31 AM
12-02-2008 09:31 AM
Due to DFGrays reply, i made some tests on this question. It seems that there is a different behaviour if the CTRL + C is captured by <This VI> vs. a certain control. In fact, capturing CTRL + <Any key> is not possible for controls.
Attached you can find a workaround based on DFGrays suggestion.
The issue is reported as CAR #135342.
hope this helps,
Norbert