You can catch keypress events in CVI. For example, install a callback for the panel you want to display by pressing the hotkeys. Inside the callback, test for the EVENT_KEYPRESS event. You can use the GetKeypressEventModifiers and the GetKeypressEventCharacter functions inside the callback to get the modifier and character keys pressed. However, only one modifier key and one characer key is supported. For example, you can catch the keypress "M" and "ALT + M" but not "CTRL + ALT + M". CVI claims support for the "CTRL + SHIFT" modifier but I couldn't get it to work.
Additionally, with this method, you have no information about the sequence of keys pressed. My recommendation is to implement a hot key sequence using only one modifier such as "ALT + A + B + C". I
n this way, three keypress events will be generated as "ALT + A", "ALT + B", "ALT + C". For the first event, you can set a flag. For the second event, you test this flag. If this has been set, you know that key #1 has been hit and set the second event flag, and so on... The code below shows what I'm talking about. Hope this helps. If you find a more graceful solution, let me know.
switch (event) {
case EVENT_KEYPRESS:
character = GetKeyPressEventModifiers (eventData2);
//VAL_UNDERLINE_MODIFIER == "ALT"
//you can also use VAL_MENUKEY_MODIFIER which is "CTRL"
if (character == (VAL_UNDERLINE_MODIFIER)) {
character = GetKeyPressEventCharacter (eventData2);
if (character == 'A') {
ClearFlags ();
Key1 = 1;
}
if (character == 'B') {
if (Key1 == 1) {
Key2 == 1;
}
else {
ClearFlags ();
}
}
//the rest of the sequences here
break;
}