stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / steam.h
diff --git a/steam.h b/steam.h
index a92c3252e66b1b503b993ecaf1afd32db88798aa..a417622c5a17e246a0fe4e456924dd38dbab448a 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -240,6 +240,29 @@ VG_STATIC int steam_init(void)
                .function = steam_set_achievemnt_test
        });
 
+   vg_info( "Checking controller type\n" );
+
+   ISteamInput *hInput = SteamAPI_SteamInput();
+   SteamAPI_ISteamInput_Init( hInput, 0 );
+   SteamAPI_ISteamInput_RunFrame( hInput, 0 );
+   InputHandle_t joy0 = SteamAPI_ISteamInput_GetControllerForGamepadIndex( 
+                           hInput, 0 );
+
+   if( joy0 != 0 )
+   {
+      ESteamInputType type = SteamAPI_ISteamInput_GetInputTypeForHandle(
+                           hInput, joy0 );
+
+      if( type == k_ESteamInputType_SteamController )
+         vg.gamepad_use_trackpad_look = 1;
+
+      vg_info( "Type: %d\n", type );
+   }
+   else
+   {
+      vg_warn( "none found\n" );
+   }
+   
 #endif
 
    /* TODO: On username update callback */