05-04-2011 02:28 PM
How to use shortcut modifier as ALT key with CVI 9.0? Is there any direct way than using windows functions?
Solved! Go to Solution.
05-04-2011 02:49 PM
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. |
05-04-2011 03:03 PM
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?
05-04-2011 03:12 PM
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.
06-06-2011 02:09 PM
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.
06-07-2011 04:43 PM
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.
06-08-2011 02:57 AM - edited 06-08-2011 02:59 AM
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.