Page 1 of 1
Posted: Mon Feb 13, 2012 8:12 pm
I am having trouble with toggling SLEW mode.
SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_SLEW_SET, "SLEW_TOGGLE");
to set up the event and
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_SLEW_SET,0,SIMCONNECT_GROUP_PRIORITY_DEFAULT, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
to activate it but it doesn't work.
I can perform similar steps to toggle pause mode and that works fine.
Can anyone shed any light on what I am missing here .
Posted: Tue Feb 14, 2012 3:50 am
Your syntax looks absolutely fine, SLEW_TOGGLE should work
Have you tried setting the DWORD to 1 (instead of 0) ? '0' should work but maybe it needs a '1' to get the toggle to activate???
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_SLEW_SET,1,SIMCONNECT_GROUP_PRIORITY_DEFAULT, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
Alternatively is it possible to use 2 events instead: ie SLEW_ON and SLEW_OFF, not as elegant but if there is a bug with SLEW_TOGGLE it's a temporary work-around.
Posted: Tue Feb 14, 2012 12:03 pm
Thanks for the reply. I have tried using 1 instead of 0 and I have also tried SLEW_ON / OFF to no effect
hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_ZX, "ctrl+shift+A", EVENT_SLEW_TOGGLE);
(and changing previous id EVENT_SLEW_SET to EVENT_SLEW_TOGGLE)
works when I press 'ctrl+shift+A' at the P3d focused keyboard. That's all very well but I want to toggle externally by command from the Simconnect client ie via SimConnect_TransmitClientEvent).
Trying to Freeze the aircraft using the appropriate EVENT ids and SimConnect_TransmitClientEvent also proved negative. Have I got the wrong end of the stick in usage or should It be just as simple as using SimConnect_MapClientEventToSimEvent and SimConnect_TransmitClientEvent ?
Posted: Tue Feb 14, 2012 12:23 pm
I'm just a beginner with SimConnect myself, I tend to create all my custom controls and events as embedded DLLs. So are you using SLEW as a method of freezing the aircraft (without pausing) or are you then subsequently slewing the aircraft? You state above that you want to Freeze the aircraft so have you tried FREEZE_LATITUDE_LONGITUDE_TOGGLE, FREEZE_ATTITUDE_TOGGLE and FREEZE_ALTITUDE_TOGGLE instead??
Posted: Tue Feb 14, 2012 3:31 pm
I have tried the FREEZE events as above without success leading me to think I must be missing a step.
Originally the idea was to have FSX render our simulator(s) visual world only and not digging too deep into the SDK I came up with moving a default aircraft around. Slew was required to stop simulation position updates interfering with the client updates (jitters) and worked very well (pausing and updating wasn't an option as terrain height feedback wasn't updated). Now of course, with P3D, I can delve deeper into external sim mode but I would still like to find the solution to the current issue as I'll possibly need control over a number of other events.
Posted: Thu Feb 16, 2012 8:51 pm
ObjectID should be set to 1 for SimConnect_TransmitClientEvent to work on user aircraft.
If set to 0 it works on general sim events for example "PAUSE_TOGGLE" , pauses/unpauses whole simulation I assume.
I could've sworn I did the above originally. I'm Swearing now.
Incidently, it has been indicated that the user aircraft ID isn't always 1 and can change for example in multilayer mode