Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disbale joystick axis with SimConnect -> doesn't work ?

Featured Replies

  • Commercial Member

Hi all,I've spent most of the past 2 days looking for a way to disable the joystick axis via SimConnect but it doesn't seem to want to work !Here's the code for the X axis:if (SUCCEEDED(SimConnect_Open(&hSimConnect, "A300 Event", NULL, 0, 0, 0))){SimConnectOpen = true;//I use this event to change the state of the axis hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_1HZ, "1sec");hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_XAXIS); hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_JOYSTICK, EVENT_XAXIS);hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_JOYSTICK, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_XAXIS, "joystick:0:XAxis", EVENT_XAXIS, 0, (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, 0, true);hr = SimConnect_SetInputGroupPriority(hSimConnect, INPUT_XAXIS, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE); SimConnect_CallDispatch(hSimConnect, MyDispatchProcMI, NULL);}Then I catch the event:case SIMCONNECT_RECV_ID_EVENT:{ SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData; switch(evt->uEventID) {case EVENT_1HZ://Roll and pitchif ( green_accu_exp < 1450 && blue_accu_exp < 1450 && yellow_accu_exp < 1450 && XAXIS_ON ) { hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_XAXIS, SIMCONNECT_STATE_OFF); XAXIS_ON = 0;}else { if ( XAXIS_ON == 0 && (green_accu_exp > 1450 || blue_accu_exp > 1450 || yellow_accu_exp > 1450)){ hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_XAXIS, SIMCONNECT_STATE_ON); hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_YAXIS, SIMCONNECT_STATE_ON); XAXIS_ON = 1; }}break;}All the hr's return S_OK so things seem to work as they should, but you guessed it... the joystick axis are not disabled !Did I miss anything ? I use the Saitek X52, would this need to be accessed as joystick:1 maybe ?Bj

simcheck_sig_banner_devteam.jpg

 

Bj

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.