press and hold. Do NOT release.
    accepts as many arguments as you want.
    e.g. pressAndHold('left_arrow', 'a','b').
976114
def pressAndHold(*args):
    '''
    
    '''
    for i in args:
        win32api.keybd_event(VK_CODE[i], 0,0,0)
        time.sleep(.05)
57966
function (key) {
        let _that = this[PRIVATE];

        key = KEYMAP[key.toUpperCase()];
        if (key < _that.pressed.length && key != null) {
            _that.pressed[key] = true;
        }
    }
1262461
def handle(self, *args, **options):

        
        if not options['force']:
            counter = 0
            for key in options:
                if options[key]:
                    counter += 1

            # If no options are set, do a normal patch
            if counter == 1:
                options['patch'] = True

            # more then one options are not enabled per default
            if counter >= 3:
                # TODO: Raise Error!
                exit('It is not recommended to use more then one parameter. Use -f to force your command.')
        ###########################################################################################

        if options['major']:
            Version.set_major()

        if options['minor']:
            Version.set_minor()

        if options['patch']:
            Version.set_patch()

        if options['dev']:
            Version.set_patch(Version.DEV)

        if options['alpha']:
            Version.set_patch(Version.ALPHA)

        if options['beta']:
            Version.set_patch(Version.BETA)

        if options['rc']:
            Version.set_patch(Version.RC)

        """
        Automatic commands.
        Depends on User Settings.
        """
        if APISettings.PATCH_AUTO_COMMIT:
            Git.add()
            Git.commit()

        if APISettings.PATCH_AUTO_TAG:
            Git.tag()
            if APISettings.PATCH_AUTO_TAG_PUSH:
                Git.push_tags()
293175
def handler(value)
      if value.zero?
        @up_callback.call if @up_callback
      else
        @last_press = Time.now
        @down_callback.call if @down_callback
      end

      if value.zero? && (Time.now - @last_press) > @hold_time
        @hold_callback.call if @hold_callback
      end
    end
979209
def mouse_release_event(self, x, y, button):
        """"""
        if button == 1:
            print("Left mouse button released @", x, y)
        if button == 2:
            print("Right mouse button released @", x, y)
923544
def unhold(self):
        ''' 

        '''
        # no-op if we are already no holding
        if self._hold is None: return

        self._hold = None
        events = list(self._held_events)
        self._held_events = []

        for event in events:
            self._trigger_on_change(event)
547462
def handle_left_double_click(self, info):
        
        if (self.double_click_focus == False):  # turn focus on
            print(self.pre, "handle_left_double_click: focus on")
            self.cb_focus()
        else:  # turn focus off
            print(self.pre, "handle_left_double_click: focus off")
            self.cb_unfocus()
        self.double_click_focus = not(
            self.double_click_focus)
315994
def tap_and_hold(self, xcoord, ycoord):
        
        self._actions.append(lambda: self._driver.execute(
            Command.TOUCH_DOWN, {
                'x': int(xcoord),
                'y': int(ycoord)}))
        return self
978511
def on_press(self, window, key, scancode, action, mods):
        

        # controls for moving position
        if key == glfw.KEY_W:
            self.pos[0] -= self._pos_step  # dec x
        elif key == glfw.KEY_S:
            self.pos[0] += self._pos_step  # inc x
        elif key == glfw.KEY_A:
            self.pos[1] -= self._pos_step  # dec y
        elif key == glfw.KEY_D:
            self.pos[1] += self._pos_step  # inc y
        elif key == glfw.KEY_F:
            self.pos[2] -= self._pos_step  # dec z
        elif key == glfw.KEY_R:
            self.pos[2] += self._pos_step  # inc z

        # controls for moving orientation
        elif key == glfw.KEY_Z:
            drot = rotation_matrix(angle=0.1, direction=[1., 0., 0.])[:3, :3]
            self.rotation = self.rotation.dot(drot)  # rotates x
        elif key == glfw.KEY_X:
            drot = rotation_matrix(angle=-0.1, direction=[1., 0., 0.])[:3, :3]
            self.rotation = self.rotation.dot(drot)  # rotates x
        elif key == glfw.KEY_T:
            drot = rotation_matrix(angle=0.1, direction=[0., 1., 0.])[:3, :3]
            self.rotation = self.rotation.dot(drot)  # rotates y
        elif key == glfw.KEY_G:
            drot = rotation_matrix(angle=-0.1, direction=[0., 1., 0.])[:3, :3]
            self.rotation = self.rotation.dot(drot)  # rotates y
        elif key == glfw.KEY_C:
            drot = rotation_matrix(angle=0.1, direction=[0., 0., 1.])[:3, :3]
            self.rotation = self.rotation.dot(drot)  # rotates z
        elif key == glfw.KEY_V:
            drot = rotation_matrix(angle=-0.1, direction=[0., 0., 1.])[:3, :3]
            self.rotation = self.rotation.dot(drot)
421379
def on_button_press(self, event):
        
        if event.get_button()[1] not in self._buttons:
            return False  # Only handle events for registered buttons (left mouse clicks)

        if event.get_state()[1] & constants.RUBBERBAND_MODIFIER:
            return False  # Mouse clicks with pressed shift key are handled in another tool

        # Special case: moving the NameView
        # This is only allowed, if the hovered item is a NameView and the Ctrl-key is pressed and the only selected
        # item is the parental StateView. In this case, the selection and _item will no longer be looked at,
        # but only _move_name_v
        self._item = self.get_item()
        if isinstance(self._item, NameView):
            selected_items = self.view.selected_items
            if event.get_state()[1] & Gdk.ModifierType.CONTROL_MASK and len(selected_items) == 1 and next(iter(selected_items)) is \
                    self._item.parent:
                self._move_name_v = True
            else:
                self._item = self._item.parent

        if not self._move_name_v:
            self._old_selection = self.view.selected_items
            if self._item not in self.view.selected_items:
                # When items are to be moved, a button-press should not cause any deselection.
                # However, the selection is stored, in case no move operation is performed.
                self.view.handle_new_selection(self._item)

        if not self.view.is_focus():
            self.view.grab_focus()

        return True
891277
def mousePressEvent(self, event):
        
        if event.button() == Qt.LeftButton:
            self._drag_origin = event.pos()
        widget = self.widget
        type(widget).mousePressEvent(widget, event)
638967
def handle_set_command(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        """"""
        key, value = tokens['key'], tokens['value']
        self.raise_for_invalid_annotation_value(line, position, key, value)
        self.annotations[key] = value
        return tokens
73219
function saveBreakHold() {
    if (editor.binding && editor.holding) {
      generator.clientUpdateFragmentText(editor.binding, editor.$edit.val(), true);
      editor.holding = false;
    }
  }
334003
def _left_click(self, event):
        """"""
        self.update_active()
        iid = self.current_iid
        if iid is None:
            return
        args = (iid, event.x_root, event.y_root)
        self.call_callbacks(iid, "left_callback", args)
1168257
def mouse_press_event(self, event):
        
        # Support left and right mouse button for now
        if event.button() not in [1, 2]:
            return

        self.example.mouse_press_event(event.x(), event.y(), event.button())
1069896
def mouse_press_event(self, x, y, button):
        """"""
        if button == 1:
            print("Left mouse button pressed @", x, y)
        if button == 2:
            print("Right mouse button pressed @", x, y)
401270
def retract(args):
    """"""
    if not args.msg:
        return "Syntax: !vote retract <pollnum>"
    if not args.msg.isdigit():
        return "Not A Valid Positive Integer."
    response = get_response(args.session, args.msg, args.nick)
    if response is None:
        return "You haven't voted on that poll yet!"
    args.session.delete(response)
    return "Vote retracted"