def button_count(vjoy_id): """Returns the number of buttons of the given vJoy device. :param vjoy_id id of the vjoy device :return number of buttons """ return VJoyInterface.GetVJDButtonNumber(vjoy_id)
def _init_buttons(self): """Retrieves all buttons present on the vJoy device and creates their control objects. :returns list of Button objects """ buttons = {} for btn_id in range(1, VJoyInterface.GetVJDButtonNumber(self.vjoy_id)+1): buttons[btn_id] = Button(self, btn_id) return buttons