inputTest.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //-----------------------------------------------------------------------------
  2. // Module creation functions.
  3. //-----------------------------------------------------------------------------
  4. function inputTest::create( %this )
  5. {
  6. }
  7. function inputTest::destroy( %this )
  8. {
  9. }
  10. function inputTest::initClient( %this )
  11. {
  12. %this.queueExec("/scripts/customProfiles.cs");
  13. %this.queueExec("/scripts/inputMonitor.cs");
  14. %this.queueExec("/scripts/gui/inputMonitor.gui");
  15. %this.queueExec("/scripts/joystickSettings.cs");
  16. %this.queueExec("/scripts/gui/joystickSettings.gui");
  17. %this.queueExec("/scripts/menuButtons.cs");
  18. }
  19. function onSDLDeviceConnected(%sdlIndex, %deviceName, %deviceType)
  20. {
  21. echo("onSDLDeviceConnected(" @ %sdlIndex @ ", \"" @ %deviceName @ "\", \"" @ %deviceType @ "\") - Called");
  22. // Note: This is called before the device is automatically processed to allow
  23. // overrides, so refreshing the gui needs to happen after the device has been opened
  24. if (JoystickSettingsDlg.isAwake())
  25. JoystickSettingsDlg.schedule(250, "updateDevices");
  26. if (InputMonitorDlg.isAwake())
  27. InputMonitorDlg.schedule(250, "updateDevicesLine");
  28. }
  29. function onSDLDeviceDisconnected(%sdlIndex)
  30. {
  31. echo("onSDLDeviceDisconnected(" @ %sdlIndex @ ") - Called");
  32. if (JoystickSettingsDlg.isAwake())
  33. JoystickSettingsDlg.schedule(250, "updateDevices");
  34. if (InputMonitorDlg.isAwake())
  35. InputMonitorDlg.schedule(250, "updateDevicesLine");
  36. }
  37. function listAllGCMappings()
  38. { // Lists all game controller device mappings that are currently installed
  39. %numMappings = SDLInputManager::GameControllerNumMappings();
  40. for (%i = 0; %i < %numMappings; %i++)
  41. echo(SDLInputManager::GameControllerMappingForIndex(%i));
  42. }