handle rally alt change
512757
def cmd_rally_alt(self, args):
        ''''''
        if (len(args) < 2):
            print("Usage: rally alt RALLYNUM newAlt <newBreakAlt>")
            return
        if not self.have_list:
            print("Please list rally points first")
            return

        idx = int(args[0])
        if idx <= 0 or idx > self.rallyloader.rally_count():
            print("Invalid rally point number %u" % idx)
            return

        new_alt = int(args[1])
        new_break_alt = None
        if (len(args) > 2):
            new_break_alt = int(args[2])

        self.rallyloader.set_alt(idx, new_alt, new_break_alt)
        self.send_rally_point(idx-1)
        self.fetch_rally_point(idx-1)
        self.rallyloader.reindex()
799193
def _on_prop_changed(self, instance, meth_name, res, args, kwargs):
        """"""
        Adapter._on_prop_changed(self)
616328
def remap_hotkey(src, dst, suppress=True, trigger_on_release=False):
    
    def handler():
        active_modifiers = sorted(modifier for modifier, state in _listener.modifier_states.items() if state == 'allowed')
        for modifier in active_modifiers:
            release(modifier)
        send(dst)
        for modifier in reversed(active_modifiers):
            press(modifier)
        return False
    return add_hotkey(src, handler, suppress=suppress, trigger_on_release=trigger_on_release)
632923
def handle_o_r_g_r(tokens, options)
      outer_span = get_anchor(tokens[2..3], options)
      handle_orr(tokens[0..1], outer_span, options)
    end
1369240
def Alt_Fn(self, n, dl = 0):
        
        self.Delay(dl)
        self.keyboard.press_key(self.keyboard.alt_key)
        self.keyboard.tap_key(self.keyboard.function_keys[n])
        self.keyboard.release_key(self.keyboard.alt_key)
84108
def on_top_level_changed(self, top_level):
        """"""
        if top_level:
            self.undock_action.setDisabled(True)
        else:
            self.undock_action.setDisabled(False)
938635
function(ev) {
        if (window.navigator.platform.match(/Mac/)) {
            // metaKey maps to ⌘ on Macs
            return ev.metaKey;
        }
        else {
            // Both altKey and ctrlKey == true on some Windows keyboards when the right-hand ALT key is pressed
            // so just be safe and make sure altKey == false
            return (ev.ctrlKey && !ev.altKey);
        }
    }
1116647
def change(self, fn, edge=edges.BOTH):
        """"""

        def wrapped(pin):
            fn(self.value)

        GPIO.add_event_callback(self._pin, wrapped)
483811
function _handleExternalChange(evt, doc) {
        if (doc) {
            _removeBackwardFramesForFile(doc.file);
            _removeForwardFramesForFile(doc.file);
            _validateNavigationCmds();
        }
    }
1264728
function (e) {
            if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
                this.props.actions.cancelRename();
            } else if (e.keyCode === KeyEvent.DOM_VK_RETURN) {
                this.props.actions.performRename();
            }
        }
149954
function onchange(chg) {
		if(robot.data.mode == 3 && run == 1) { //FULL mode:
			//lightBumper is a macro for all light bump sensors (lightBumpLeft, lightBumpRight, etc)
			//Unfortunately, no similar macro exists for cliff sensors or bumper switches due to the way the data is delivered.
			if(chg.lightBumper || chg.bumpLeft || chg.bumpRight || chg.dropLeft || chg.dropRight || chg.clean || chg.docked) {
				driveLogic(); //Run drive logic only when sensor values change.
			}
			//Charging Station Detected! Since it's in front of the robot anyway... Start Auto-Docking!
			if(robot.data.irLeft == 172 || robot.data.irRight == 172) {
				robot.drive(0,0); run = -1; robot.showText("SEEK", 500, false, robot.autoDock);
			}
		} else if(robot.data.mode == 1) { //PASSIVE mode:
			if(chg.clean && robot.data.clean) { //Clean Pressed:
				if(robot.data.docked) robot.clean(); //Start backing up if clean pressed while docked.
				else preventDefault(function(){run = 1; driveLogic()}); //Prevent default.
			}
			if(chg.docked && robot.data.docked) { //Robot Docked:
				setUndock(0); robot.full(); robot.showText("DOCK", 500, false, robot.start);
			} else if(chg.docked/* && !robot.data.charger*/ && !robot.data.docked) { //Robot Undocked:
				setUndock(1);
			} else if(chg.dropLeft || chg.dropRight) { //Docking Interrupted:
				if(run == -1) {robot.full();robot.showText("RST", 500, false, robot.autoDock)}
				//else setUndock(1);
			}
		}
	}
1147737
function (bRestoreFocus, oEvent) {
			if (!this._bBlurOrKeyDownStarted) {
				this._bBlurOrKeyDownStarted = true;
				if (oEvent) {
					RenameHandler._preventDefault.call(this, oEvent);
					RenameHandler._stopPropagation.call(this, oEvent);
				}
				return this._emitLabelChangeEvent()
					.then(function (fnErrorHandler) {
						this.stopEdit(bRestoreFocus);
						if (typeof fnErrorHandler === "function") {
							fnErrorHandler(); // contains startEdit() and valueStateMessage
						}
					}.bind(this));
			}
			return Promise.resolve();
		}
339528
function _dirtyFlagChangeHandler(event, doc) {
        var $dirtyIndicators = $(".inline-text-editor .dirty-indicator"),
            $indicator;

        $dirtyIndicators.each(function (index, indicator) {
            $indicator = $(this);
            if ($indicator.data("fullPath") === doc.file.fullPath) {
                _showDirtyIndicator($indicator, doc.isDirty);
            }
        });
    }
225286
def handle_callback(hook, event, *data)
      to = machine.events_map.move_to(event.event_name, event.from, *data)
      trans_event = TransitionEvent.new(event.event_name, event.from, to)
      callable    = create_callable(hook)

      if hook.is_a?(Async)
        defer(callable, trans_event, *data)
      else
        callable.(trans_event, *data)
      end
    end
894542
def OnReplaceFind(self, event):
        """"""

        event.text = event.GetFindString()
        event.flags = self._wxflag2flag(event.GetFlags())

        self.OnFind(event)
489938
def OnSelChanged(self, event):
        """"""
        # Get the selected item object
        item = event.GetItem()
        obj = self.leftPanel.model.ItemToObject(item)
        if isinstance(obj, compass.Survey):
            l = [
                'Survey Name: %s' % obj.name,
                'Survey Date: %s' % obj.date,
                'Comment: %s' % obj.comment,
                'Team: %s' % ', '.join(obj.team),
                'Surveyed Footage: %0.1f' % obj.length,
                '',
                ]
            l.extend(['  '.join(['%s: %s' % (k,v) for (k,v) in shot.items()]) for shot in obj.shots])
            self.display.SetLabel(str('\n'.join(l)))
        else:
            self.display.SetLabel('')
136231
private void handleDone() {
        // Attempt to complete the current token token
        performCompletion();

        // Hide the keyboard
        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
                Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
    }