I am trying to update an old piece of code that I have (way too large to post). It is not using WindowClass. It uses IDCMP_RAWKEY and IDCMP_VANILLAKEY and others.
I have updated the old window to the new WindowClass so I can use ReAction classes. Now I don't receive any VANILLAKEYs, neither WMHI_VANILLAKEY or IDCMP_VANILLAKEY. I only get WMHI_RAWKEY.
Do I have to use a WINDOW_IDCMPHook to catch the vanillakeys? I really don't want to since it would take some serious re-writing.
Did you explicitly set IDCMPVANILLAKEY in the WA_IDCMP tag?
You need to do that to get WMHI_VANILLAKEY messages.
I had both IDCMP_RAWKEY and IDCMP_VANILLAKEY in WA_IDCMP. I took out IDCMP_RAWKEY and it started to work, I receive both now. That makes no sense.
Now what is throwing me off is I am getting the correct RAWKEY code, but wrong VANILLAKEY code.
When I revert back to the old code using IExec->Wait() and IExec->GetMsg() it all works fine.
When I use the WindowClass: while((Result=IIntuition->IDoMethod(Objects[OID_WINDOW],WM_HANDLEINPUT,&Code)) != WMHI_LASTMSG)
I get the correct Result (Class) but the Code is wrong for VanillaKey.
Key | Old | New
1 | 49 | 129
Q | 113 | 144
A | 97 | 160
Z | 122 | 177
New Code values totally out of the range they should be in. Any ideas?
uint32 Result;
uint16 Code, Qualifier;
IDCMP_RAWKEY is there by default as window.class requires it so adds it to the WA_IDCMP mask you pass, so whether it's present or not should make no difference.
I think you should be using result & WMHI_KEYMASK for vanilla key not 'code'.
eg
I found an example using your suggestion probably around the same time:
https://wiki.amigaos.net/wiki/Programming_AmigaOS_4:_GUI_Toolkit_ReAction
I am slowly getting it updated/working. Still a long way to go.
Thanks.