cancel
Showing results for 
Search instead for 
Did you mean: 

shortcut modifier Alt

SOLVED
lvrat
Active Participant
Solved!

shortcut modifier Alt

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

*************************************************
CLD
*************************************************
6 REPLIES 6
Wolfgang
Trusted Enthusiast

Re: shortcut modifier Alt

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.
Tags (2)
lvrat
Active Participant

Re: shortcut modifier Alt

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
*************************************************
RobertoBozzolo
Proven Zealot

Re: shortcut modifier Alt

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?
lvrat
Active Participant

Re: shortcut modifier Alt

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
*************************************************
Perry_S
NI Employee (retired)

Re: shortcut modifier Alt

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
RobertoBozzolo
Proven Zealot
Solution

Re: shortcut modifier Alt

Message contains an attachment

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?