2019-11-26 21:24:29 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Module creation functions.
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function inputTest::create( %this )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function inputTest::destroy( %this )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function inputTest::initClient( %this )
|
|
|
|
|
{
|
2021-01-07 11:01:09 +00:00
|
|
|
%this.queueExec("/scripts/customProfiles." @ $TorqueScriptFileExtension);
|
|
|
|
|
%this.queueExec("/scripts/inputMonitor." @ $TorqueScriptFileExtension);
|
2020-08-05 07:57:29 +00:00
|
|
|
%this.queueExec("/scripts/gui/inputMonitor.gui");
|
2021-01-07 11:01:09 +00:00
|
|
|
%this.queueExec("/scripts/joystickSettings." @ $TorqueScriptFileExtension);
|
2020-08-05 07:57:29 +00:00
|
|
|
%this.queueExec("/scripts/gui/joystickSettings.gui");
|
2021-01-07 11:01:09 +00:00
|
|
|
%this.queueExec("/scripts/menuButtons." @ $TorqueScriptFileExtension);
|
2019-11-26 21:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onSDLDeviceConnected(%sdlIndex, %deviceName, %deviceType)
|
|
|
|
|
{
|
|
|
|
|
echo("onSDLDeviceConnected(" @ %sdlIndex @ ", \"" @ %deviceName @ "\", \"" @ %deviceType @ "\") - Called");
|
|
|
|
|
|
|
|
|
|
// Note: This is called before the device is automatically processed to allow
|
|
|
|
|
// overrides, so refreshing the gui needs to happen after the device has been opened
|
|
|
|
|
if (JoystickSettingsDlg.isAwake())
|
|
|
|
|
JoystickSettingsDlg.schedule(250, "updateDevices");
|
|
|
|
|
if (InputMonitorDlg.isAwake())
|
|
|
|
|
InputMonitorDlg.schedule(250, "updateDevicesLine");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onSDLDeviceDisconnected(%sdlIndex)
|
|
|
|
|
{
|
|
|
|
|
echo("onSDLDeviceDisconnected(" @ %sdlIndex @ ") - Called");
|
|
|
|
|
|
|
|
|
|
if (JoystickSettingsDlg.isAwake())
|
|
|
|
|
JoystickSettingsDlg.schedule(250, "updateDevices");
|
|
|
|
|
if (InputMonitorDlg.isAwake())
|
|
|
|
|
InputMonitorDlg.schedule(250, "updateDevicesLine");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function listAllGCMappings()
|
|
|
|
|
{ // Lists all game controller device mappings that are currently installed
|
|
|
|
|
%numMappings = SDLInputManager::GameControllerNumMappings();
|
|
|
|
|
for (%i = 0; %i < %numMappings; %i++)
|
|
|
|
|
echo(SDLInputManager::GameControllerMappingForIndex(%i));
|
|
|
|
|
}
|