• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Help? what am i doing wrong?

Messages
2
Country
netherlands
Hello,

I'm using VB .NEt and i'm trying to map a certain key to an event but the event won't fire

Enum SIMCONNECT_STATE
SIMCONNECT_STATE_OFF = 0
SIMCONNECT_STATE_ON = 1
End Enum
Enum EVENT_ID
VIEWEVENT
VIEW1DOWN
VIEW1UP
VIEW2DOWN
VIEW2UP
VIEW3DOWN
VIEW3UP
VIEW4DOWN
VIEW4UP
VIEW5DOWN
VIEW5UP
VIEW6DOWN
VIEW6UP
VIEW7DOWN
VIEW7UP
VIEW8DOWN
VIEW8UP
VIEW9DOWN
VIEW9UP
VIEW0DOWN
VIEW0UP
End Enum
Enum GROUP_ID
INPUT_GROUP
GROUP_UNKNOWN
End Enum

Try
AddHandler FSX_SimConnect.OnRecvEvent, New Microsoft.FlightSimulator.SimConnect.SimConnect.RecvEventEventHandler(AddressOf simconnect_OnRecvEvent)
Catch ex As Exception
End Try

FSX_SimConnect.MapClientEventToSimEvent(EVENT_ID.VIEW1DOWN, "View1down")
FSX_SimConnect.AddClientEventToNotificationGroup(GROUP_ID.INPUT_GROUP, EVENT_ID.VIEW1DOWN, False)
FSX_SimConnect.MapClientEventToSimEvent(EVENT_ID.VIEW1UP, "View1up")
FSX_SimConnect.AddClientEventToNotificationGroup(GROUP_ID.INPUT_GROUP, EVENT_ID.VIEW1UP, False)
FSX_SimConnect.MapInputEventToClientEvent(GROUP_ID.INPUT_GROUP, "CTRL+R", EVENT_ID.VIEW1DOWN, 0, EVENT_ID.VIEW1UP, 1, False)
FSX_SimConnect.SetNotificationGroupPriority(GROUP_ID.INPUT_GROUP, SimConnect.SIMCONNECT_GROUP_PRIORITY_HIGHEST)
FSX_SimConnect.SetInputGroupState(GROUP_ID.INPUT_GROUP, SIMCONNECT_STATE.SIMCONNECT_STATE_ON)

FSX_SimConnect.SubscribeToSystemEvent(EVENT_ID.VIEW1DOWN, "View1down")
FSX_SimConnect.SubscribeToSystemEvent(EVENT_ID.VIEW1UP, "View1up")

Private Sub simconnect_OnRecvEvent(ByVal Sender As Microsoft.FlightSimulator.SimConnect.SimConnect, ByVal data As Microsoft.FlightSimulator.SimConnect.SIMCONNECT_RECV_EVENT)
Beep()
end sub

no beep is produced on pressing CTRL+R why?
i've work hours on this and looked at every example on the net
 
I'm not a VB .Net simconnect expert, but why do you use SIMCONNECT_STATE.SIMCONNECT_STATE_ON instead of True?

You have introduced and enum where a boolean is required?

edit ***********

never mind I see SIMCONNECT_STATE.ON and OFF are valid, but they seem to be microsoft values - do you really need to specify (ENUM) them?
It would also mean you need to fully qualify them

Microsoft.FlightSimulator.SimConnect.SIMCONNECT_STATE.ON


end edit ***********

Also - where are you getting EVENT_ID.V IEW1UP, "View1up" from. There is no "View1up" Sim event. You need to map your EVENT_ID.V IEW1UP event to a sim event. Perhaps VIEW_COCKPIT_FORWARD
 
Last edited:
Back
Top