def on_btAnalog_clicked(self, *a): """ 'Analog Output' handler """ b = SimpleChooser( self.app, "axis", lambda action: self.on_action_chosen("analog", action)) b.set_title(_("Select Analog Axis")) b.display_action(Action.AC_STICK, AxisAction(self.analog)) b.show(self.editor.window)
def on_btCircularAxis_clicked(self, *a): def cb(action): self.circular = action btCircularAxis = self.builder.get_object("btCircularAxis") btCircularAxis.set_label(action.describe(Action.AC_PAD)) self.editor.set_action(self.make_circular_action()) b = SimpleChooser(self.app, "axis", cb) b.set_title(_("Select Axis")) b.display_action(Action.AC_STICK, self.circular) b.show(self.editor.window)
def on_select_axis(self, source, *a): i = self.buttons.index(source) def cb(action): self.axes[i] = action.parameters[0] self.update() self.send() b = SimpleChooser(self.app, "axis", cb) b.set_title(_("Select Axis")) b.hide_mouse() b.display_action(Action.AC_STICK, AxisAction(self.axes[i])) b.show(self.editor.window)
def on_btSingleButton_clicked(self, *a): def cb(action): self.button = action btSingleButton = self.builder.get_object("btSingleButton") btSingleButton.set_label(self.button.describe(Action.AC_PAD)) self.editor.set_action(self.button) b = SimpleChooser(self.app, "buttons", cb) b.set_title(_("Select Button")) b.display_action(Action.AC_STICK, self.circular_axis) b.show(self.editor.window)
def on_btCircularAxis_clicked(self, *a): def cb(action): self.circular_axis = action btCircularAxis = self.builder.get_object("btCircularAxis") btCircularAxis.set_label(action.describe(Action.AC_PAD)) self.editor.set_action(self.make_circular_action()) b = SimpleChooser(self.app, "axis", cb) b.set_title(_("Select Axis")) b.display_action(Action.AC_STICK, self.circular_axis) b.show(self.editor.window)
def on_btCircularButton_clicked(self, button, *a): index = 0 if button == self.builder.get_object("btCircularButton0") else 1 def cb(action): self.circular_buttons[index] = action.button btCircularButton = self.builder.get_object("btCircularButton%s" % (index, )) btCircularButton.set_label(action.describe(Action.AC_PAD)) self.editor.set_action(self.make_circular_action()) b = SimpleChooser(self.app, "buttons", cb) b.set_title(_("Select Button")) b.display_action(Action.AC_STICK, self.circular_axis) b.show(self.editor.window)
def on_btCircularButton_clicked(self, button, *a): index = 0 if button == self.builder.get_object( "btCircularButton0") else 1 def cb(action): self.circular_buttons[index] = action.button btCircularButton = self.builder.get_object("btCircularButton%s" % (index, )) btCircularButton.set_label(action.describe(Action.AC_PAD)) self.editor.set_action(self.make_circular_action()) b = SimpleChooser(self.app, "buttons", cb) b.set_title(_("Select Button")) b.display_action(Action.AC_STICK, self.circular_axis) b.show(self.editor.window)
def grab_action(self, button, cb): b = SimpleChooser(self.app, "buttons", cb) b.set_title(_("Select Button")) b.hide_axes() b.display_action(Action.AC_BUTTON, ButtonAction(button)) b.show(self.editor.window)
def grab_action(self, action, cb): b = SimpleChooser(self.app, "axis", cb) b.set_title(_("Select Axis")) area = action_to_area(action) b.display_action(Action.AC_STICK, area) b.show(self.editor.window)
def on_btAnalog_clicked(self, *a): """ 'Analog Output' handler """ b = SimpleChooser(self.app, "axis", lambda action: self.on_action_chosen("analog", action) ) b.set_title(_("Select Analog Axis")) b.display_action(Action.AC_STICK, AxisAction(self.analog)) b.show(self.editor.window)