// Project: MotionInputDemo
// Created: 2015-07-12
// set window properties
CompleteRawJoystickDetection()
SetWindowTitle( "MotionInputDemo" )
SetWindowSize( 1920, 1080, 0 )
// Fix to a landscape mode
SetOrientationAllowed( 0, 0, 1, 0 )
// set display properties
SetVirtualResolution( 1920, 1080 )
//SetOrientationAllowed( 1, 1, 1, 1 )
i_NumJoys = 0
for i=1 to 4
if GetRawJoystickExists( i )
i_NumJoys = i_NumJoys + 1
endif
next i
i_Key = -1
CompleteRawJoystickDetection()
SetPrintSize( 40)
do
for i=1 to 4
if GetRawJoystickExists( i )
print("I exist!: "+str(i))
endif
next i
b_HasJoy = GetJoystickExists()
print("b_HasJoy: "+str(b_HasJoy))
if b_HasJoy
for t=1 to i_NumJoys
if GetRawJoystickConnected( t )
Print( "Gamepad detected." )
PrintC( "-Buttons:" )
for i=1 to 32
if GetRawJoystickButtonState( t, i )
PrintC(" ")
PrintC( i )
endif
next i
Print( "" )
PrintC( "-Axes: X:" )
PrintC( GetRawJoystickX( t ) )
PrintC( ", Y:" )
PrintC( GetRawJoystickY( t ) )
PrintC( ", Z:" )
Print( GetRawJoystickZ( t ) )
PrintC( "-Rotation: X:" )
PrintC( GetRawJoystickRX( t ) )
PrintC( ", Y:" )
PrintC( GetRawJoystickRY( t ) )
PrintC( ", Z:" )
Print( GetRawJoystickRZ( t ) )
Print( "" )
endif
next t
endif
// Print( ScreenFPS() )
Sync()
loop