Hi,
I finally decided to try programming using ReAction, it always looked so comlicated to me, and still does.
But I like the automatic layout and the look of it, so I will try some more.
My question is: how do I find out what caused a string gadget gadget up message (ESC key or ENTER key or HELP key).
Also I would like to know if any other keys were held down such as CTRL, ALT and SHIFT buttons.
I tried several things modifying the stringexample.c file in the SDK, but could not get it to work.
ESC, ENTER or HELP key used to enter text in Reaction string gadget
- thomasrapp
- Posts: 310
- Joined: Sat Jun 18, 2011 11:22 pm
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
I cannot tell exactly, I would have to test it myself.
In a pure Intuition environment you would receive a IDCMP_GADGETUP message and should see the key which caused it in IntuiMessage->Code and the qualifiers in IntuiMessage->Qualifier.
In ReAction all this is hidden inside window.class. You should get the code in the result from GM_HANDLEINPUT. I'm not sure how you can get the qualifier. Maybe there is a window.class attribute you can read.
In a pure Intuition environment you would receive a IDCMP_GADGETUP message and should see the key which caused it in IntuiMessage->Code and the qualifiers in IntuiMessage->Qualifier.
In ReAction all this is hidden inside window.class. You should get the code in the result from GM_HANDLEINPUT. I'm not sure how you can get the qualifier. Maybe there is a window.class attribute you can read.
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
Yes, that's what I have been doing so far.I cannot tell exactly, I would have to test it myself.
In a pure Intuition environment you would receive a IDCMP_GADGETUP message and should see the key which caused it in IntuiMessage->Code and the qualifiers in IntuiMessage->Qualifier.
I can't find a suitable attribute.In ReAction all this is hidden inside window.class. You should get the code in the result from GM_HANDLEINPUT. I'm not sure how you can get the qualifier. Maybe there is a window.class attribute you can read.
There is even another way to enter text, and that using the TAB key. I can test for that in the result of IDoMethod(obj, WM_HANDLEINPUT, &code). (The obj argument is the layout gadget that the string gadget is a child of).
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
I don't know if it will do what you want but you could search for the " peekqualifier() " function in the SDK autodocs. The "devices/inputevent.h" file lists the qualifier definitions.
AmigaOne X1000 with 2GB memory - OS4.1 FE
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
Then you can't have looked very hard. The attribute you want is called WINDOW_Qualifier.
WINDOW_Qualifier (uint16)
Current qualifiers from the IntuiMessage.Qualifier field.
Useful for obtaining the qualifiers after WM_HANDLEINPUT
has returned.
Applicability is (OM_GET)
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
Thank you both.
I just got PeekQualifier() to work when I read about WINDOW_Qualifier. I can't believe I missed that. Must be my aging eyes.
I just got PeekQualifier() to work when I read about WINDOW_Qualifier. I can't believe I missed that. Must be my aging eyes.
- thomasrapp
- Posts: 310
- Joined: Sat Jun 18, 2011 11:22 pm
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
PeekQualifier() does not necessarily give you the qualifier which was active when the string gadget was left. The IDCMP message could be delayed for whatever reason and the user could have released the qualifier key already or even pressed another one. Therefore WINDOW_Qualifier is the way to go.
Re: ESC, ENTER or HELP key used to enter text in Reaction string gadget
While that makes sense to me, I would like to add that here I don't get the qualifiers at WMHI_GADGETUP, but I do at WMHI_RAWKEY. So I would have to remember them until the WMHI_GADGETUP message. An IDCMP_GADGETUP message simply supplies them immediately and without any room for error.