01-30-2007 10:14 AM
I am using LabWindows/CVI Version 6.0.
The EVENT_COMMIT is generated when user press the <Enter> or <Space> if the active control is a command button.
My question is : is it possible to prohibit the Space bar generating the commit event in this case?
01-30-2007 10:25 AM
Hello,
You should catch the keypress using the EVENT_KEYPRESS event in the callback function of the control. Check if the keypress is <Enter> or <Space> and if so, swallow the keypress using the SetKeyPressEventKey function:
case EVENT_KEYPRESS:
if (GetKeyPressEventVirtualKey (eventData2) == VAL_ENTER_VKEY ||
GetKeyPressEventCharacter (eventData2) == ' ')
SetKeyPressEventKey (eventData2, 0, 0, 0, 0, 0);
break;
Hope this can help you further.
01-30-2007 11:13 AM