LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

shortcut modifier Alt

Solved!
Go to solution

How to use shortcut modifier as ALT key with CVI 9.0? Is there any direct way than using windows functions?

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 7
(4,043 Views)
VAL_UNDERLINE_MODIFIER The <Alt> key.
VAL_SHIFT_MODIFIER The <Shift> key.
VAL_MENUKEY_MODIFIER The <Ctrl> key.
VAL_SHIFT_AND_MENUKEY Both the <Shift> key and the <Ctrl> key.
0 Kudos
Message 2 of 7
(4,042 Views)

I suppose that can be used with EVENT_KEYPRESS but how should it be provided in button. On edit the modifier drop down does not has an option for ALT? 

*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 7
(4,036 Views)

This is because the ALT key is automatically assigned to letters prepended by double underscores in the control labels.

That is, if you write a lable '__Stop' it will be written as 'Stop' in the control and it will be automatically operated by pressing Alt+S.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 7
(4,033 Views)

I have buttons from 0 to 3 on GUI for which ALT_<bttn number> is used and it selects the button. How can a particular button on GUI from 0 to 3 be selected by simply pressing numbers on the keypad, say when  0 pressed then  0 button on GUI will be selected. Looks like on one of the machines this is happening but not on another machine. Puzzled as to what is happening here. TIA. 

*************************************************
CLD
*************************************************
0 Kudos
Message 5 of 7
(4,006 Views)

Hi Lvrat,

 

The only way to accomplish what you want is to use the EVENT_KEYPRESS. You cannot cut the ALT part of the function out in any other way.

 

Perry S.

Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,992 Views)
Solution
Accepted by lvrat

A possible alternative is to assign a hotkey using windows SDK APIs and process system events: the attached sample does this job assigning hotkeys to both keyboard and numeric keypad keys; the sample discriminates the key pressed and fires the corresponding button callback (by the way, button 0 is only activated by alt+keyboard '0', numeric keypad does not trigger the button).

 

You will need to be careful when to activate hotkeys, though, to discriminate when pressing '0' is used to fire a button or is simply a regular input by the user with no other special meaning.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 7
(3,983 Views)