Reaction String Gadget wmh_Code field

Have a question about our Software Developer Kit? Ask them here.
Post Reply
User avatar
tbreeden
Posts: 160
Joined: Sat Jun 18, 2011 12:57 am
Location: Charlottesville, VA, USA
Contact:

Reaction String Gadget wmh_Code field

Post 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

User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: Reaction String Gadget wmh_Code field

Post 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.
ExecSG Team Lead

User avatar
tbreeden
Posts: 160
Joined: Sat Jun 18, 2011 12:57 am
Location: Charlottesville, VA, USA
Contact:

Re: Reaction String Gadget wmh_Code field

Post 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

Post Reply