Warning: Undefined array key 34 in /mnt/web218/a3/28/510129628/htdocs/xmlhelp.php on line 522 GLBasic User Manual

GLBasic User Manual

Main sections

FORCEFEEDBACK

FORCEFEEDBACK nJoy#, duration#, x_motor#, y_motor#



Activates a force on the force feedback joystick numbered nJoy#. The duration# time is set in milliseconds. A new call to FORCEFEEDBACK will purge any current settings. motor# is a value from -1 to 1 and indicates the power of the force (-1 is usually to the left, +1 is to the right).

If the device has only a rumble feature, setting both motor values to 1 will cause it to rumble.

You can alternatively set one of the motors to 1, and -1 interchangeably, to cause a real force feedback joystick to emulate a rumble feature as well - be aware that this may not be good for the joystick though.

// --------------------------------- //
// Project: ForceFeedback - Test
// IDE Version: 2.50107

LIMITFPS 50 // 20 ms / frame
id = 0
WHILE TRUE
jx = GETJOYX(id)
jy = GETJOYY(id)
PRINT "+", 160, 160
PRINT "X", jx*160+160, jy*160+160
FORCEFEEDBACK id, 21, jx, jy
SHOWSCREEN
WEND

See also...