MorphOS Developer
Posts: 2968 from 2003/3/5
From: Canada
You are not allowed to modify the list returned by ObtainSensorsList - and you should NOT keep that list around. That prevents removing the sensors from the system if a gamepad is unplugged.
What you should do instead is:
- ObtainSensorsList() to find the gamepad you need; make a copy of sensors and their attributes if you need to keep your own list,
- StartSensorNotify for gamepads you've selected for use in game
- ReleaseSensorsList()
Then if you get a notify that the gamepads list has changed, obtain the sensors list again, see if the gamepads you have a notify pending on are still there. If yes, keep them around. If no, StopSensorNotify on them and pick new ones.
Hope this explains it.