Page 1 of 1

Reaction String Gadget wmh_Code field

PostPosted: Thu May 16, 2013 4:21 pm
by tbreeden
I'd like to be able to detect whether a Reaction String Gadget was exited by a TAB entry
or an ENTER entry , (or a gadget deactivation).

The string_gc Autodocs (53.20) don't specifically address the code field after WMHI_HANDLEINPUT,
but it seems that Reaction extends Intuition here by returning wmh_Code of 0 for ENTER
and 9 for TAB.

This behavior is what is documented for GadTools, so it seems reliable for Reaction. But
it should be documented.

Also, the Reaction STRINGA_RelVerifySpecial attribute can be used to get a GadgetUp
on gadget deactivation. Experimenting seems to show that wmh_Code comes back
as 10 in this case. Is that reliable?

Thanks,

Tom

Re: Reaction String Gadget wmh_Code field

PostPosted: Thu May 16, 2013 4:41 pm
by ssolie
I have found the best and most reliable way to interact with a string gadget is via an editing hook.

If you are messing with special keys and such that is really the best way to control things.

Re: Reaction String Gadget wmh_Code field

PostPosted: Sat May 18, 2013 4:51 pm
by tbreeden
Thanks. I'll go in the direction of a string gad hook.

Still, it would be useful to have a systematic list of the uses or
non-uses of whm_Code in Reaction.

Tom