def axis_count(vjoy_id): """Returns the number of axes of the given vJoy device. :param vjoy_id id of the vjoy device :return number of axes """ count = 0 for axis in AxisName: if VJoyInterface.GetVJDAxisExist(vjoy_id, axis.value) > 0: count += 1 return count
def _init_axes(self): """Retrieves all axes present on the vJoy device and creates their control objects. :returns dictionary of Axis objects """ axes = {} for i, axis in enumerate(AxisName): if VJoyInterface.GetVJDAxisExist(self.vjoy_id, axis.value) > 0: axes[i+1] = Axis(self, axis.value) self._axis_names[i+1] = gremlin.common.vjoy_axis_names[i] self._axis_lookup[len(self._axis_names)] = i+1 self._axis_lookup[axis] = i+1 return axes