I am opening a window with a string gadget and OK and Cancel buttons. I use WMHI_VANILLAKEY to catch Enter (13) and Escape (27) keys to act as if the buttons were clicked.
The problem I have is when typing in string gadget and hit Enter it automatically closes the window at VANILLAKEY with Enter (13) key. How do I stop this?
I want:
type type type ENTER
deactivate string gadget
Enter (fake click on OK button)
I have been trying to catch it with a hook but can't quite get it to do want I want.
LAYOUT_AddChild, ChildObjects[GAD_STRING]=StringObject, GA_ID, GAD_STRING, GA_RelVerify, TRUE, GA_TabCycle, TRUE, STRINGA_TextVal, "", STRINGA_WorkBuffer, GlobalStringBuffer, STRINGA_MaxChars, 128, STRINGA_MinVisible, 25, STRINGA_EditHook, catchEnterHook, TAG_DONE),
I have put GA_RelVerify to FALSE, also.
Catch the GADGETUP event from the string gadget and ignore the following VANILLAKEY event.
That's what I ended up doing. But what was throwing me for a loop was I was not receiving GADGETUP signals from the string gadget. I had to add IDCMP_GADGETUP to the WA_IDCMP tag. I don't have to do that in the main window, but I did for this secondary window.
Thanks