Update the strength indicator (called by onKeyPress)
190235
function() {
  	     var strength = inputEx.PasswordField.getPasswordStrength(this.getValue());
        for(var i = 0 ; i < 4 ; i++) {
           var on = (strength >= i*25) && (strength>0);
           YAHOO.util.Dom.setStyle(this.strengthBlocks[i],"background-color", on ? "#4AE817" : "#FFFFFF");
		  }
     }
476346
def on_feed_key(self, key_press):
        """"""
        if key_press.key in {Keys.Escape, Keys.ControlC}:
            echo(carriage_return=True)
            raise Abort()
        if key_press.key == Keys.Backspace:
            if self.current_command_pos > 0:
                self.current_command_pos -= 1
            return key_press
        ret = None
        if key_press.key != Keys.CPRResponse:
            if self.current_command_pos < len(self.current_command):
                current_key = self.current_command_key
                ret = KeyPress(current_key)
                increment = min(
                    [self.speed, len(self.current_command) - self.current_command_pos]
                )
                self.current_command_pos += increment
            else:
                # Command is finished, wait for Enter
                if key_press.key != Keys.Enter:
                    return None
                self.current_command_index += 1
                self.current_command_pos = 0
                ret = key_press
        return ret
397863
def keyPressEvent(self, event):
        """"""
        if event == QKeySequence.Copy:
            self.copy()
        else:
            QTableView.keyPressEvent(self, event)
1298164
def update(self, event_or_list):
        """"""

        for e in super().update(event_or_list):
            if e.type == MOUSEBUTTONDOWN:
                if e.pos in self:
                    self.click()
                else:
                    self.release(force_no_call=True)

            elif e.type == MOUSEBUTTONUP:
                self.release(force_no_call=e.pos not in self)

            elif e.type == MOUSEMOTION:
                if e.pos in self:
                    self.hovered = True
                else:
                    self.hovered = False
51645
public void setOnkeypress(java.lang.String onkeypress) {
        getStateHelper().put(PropertyKeys.onkeypress, onkeypress);
        handleAttribute("onkeypress", onkeypress);
    }
1063917
def OnUpdate(self, event):
        """"""

        # Gray out undo and redo id not available

        undo_toolid = self.label2id["Undo"]
        redo_toolid = self.label2id["Redo"]

        self.EnableTool(undo_toolid, undo.stack().canundo())
        self.EnableTool(redo_toolid, undo.stack().canredo())

        # Set ToolTip strings to potential next undo / redo action
        undotext = undo.stack().undotext()
        undo_tool = self.FindTool(undo_toolid)
        if undotext is None:
            undo_tool.SetShortHelp(_("No undo actions available"))
        else:
            undo_tool.SetShortHelp(undotext)

        redotext = undo.stack().redotext()
        redo_tool = self.FindTool(redo_toolid)
        if redotext is None:
            redo_tool.SetShortHelp(_("No redo actions available"))
        else:
            redo_tool.SetShortHelp(redotext)

        self.Refresh()

        event.Skip()
1154903
def on_KeyPress(self,event):
        ''''''
        if event.GetKeyCode() == wx.WXK_UP:
            self.dist10deg += 0.1
            print('Dist per 10 deg: %.1f' % self.dist10deg)
        elif event.GetKeyCode() == wx.WXK_DOWN:
            self.dist10deg -= 0.1
            if self.dist10deg <= 0:
                self.dist10deg = 0.1
            print('Dist per 10 deg: %.1f' % self.dist10deg)
        # Toggle Widgets
        elif event.GetKeyCode() == 49: # 1
            widgets = [self.modeText,self.wpText]
            self.toggleWidgets(widgets)  
        elif event.GetKeyCode() == 50: # 2
            widgets = [self.batOutRec,self.batInRec,self.voltsText,self.ampsText,self.batPerText]
            self.toggleWidgets(widgets)     
        elif event.GetKeyCode() == 51: # 3
            widgets = [self.rollText,self.pitchText,self.yawText]
            self.toggleWidgets(widgets)                 
        elif event.GetKeyCode() == 52: # 4
            widgets = [self.airspeedText,self.altitudeText,self.climbRateText]
            self.toggleWidgets(widgets)
        elif event.GetKeyCode() == 53: # 5
            widgets = [self.altHistRect,self.altPlot,self.altMarker,self.altText2]
            self.toggleWidgets(widgets)
        elif event.GetKeyCode() == 54: # 6
            widgets = [self.headingTri,self.headingText,self.headingNorthTri,self.headingNorthText,self.headingWPTri,self.headingWPText]
            self.toggleWidgets(widgets)
            
        # Update Matplotlib Plot
        self.canvas.draw()
        self.canvas.Refresh()                       
        
        self.Refresh()
        self.Update()
218437
def _nt_on_change(self, key, value, isNew):
        """"""
        self._send_update({"k": key, "v": value, "n": isNew})
1349254
protected void updateStatusBar() {
		if (statusBar != null) {
			int all = getBaseEventList().size();
			int showing = getFinalEventList().size();
			String msg;
			if (all == showing) {
				String[] keys = new String[] {
						modelId + "." + SHOWINGALL_MSG_KEY, SHOWINGALL_MSG_KEY };
				msg = getApplicationConfig().messageResolver().getMessage(
						keys,
						new Object[] {
								"" + all,
								(all != 1) ? objectPluralName
										: objectSingularName });
			} else {
				String[] keys = new String[] {
						modelId + "." + SHOWINGN_MSG_KEY, SHOWINGN_MSG_KEY };

				msg = getApplicationConfig().messageResolver().getMessage(
						keys,
						new Object[] {
								"" + showing,
								(showing != 1) ? objectPluralName
										: objectSingularName, "" + all });
			}
			// Now add the selection info
			int nselected = getTable().getSelectedRowCount();
			if (nselected > 0) {
				String[] keys = new String[] {
						modelId + "." + SELECTEDN_MSG_KEY, SELECTEDN_MSG_KEY };

				msg += getApplicationConfig().messageResolver().getMessage(keys,
						new Object[] { "" + nselected });
			}
			statusBar.setMessage(msg.toString());
		}
	}
327108
def OnUpdateUI(self, evt):
        """"""

        # check for matching braces
        brace_at_caret = -1
        brace_opposite = -1
        char_before = None
        caret_pos = self.GetCurrentPos()

        if caret_pos > 0:
            char_before = self.GetCharAt(caret_pos - 1)
            style_before = self.GetStyleAt(caret_pos - 1)

        # check before
        if char_before and chr(char_before) in "[]{}()" and \
           style_before == stc.STC_P_OPERATOR:
            brace_at_caret = caret_pos - 1

        # check after
        if brace_at_caret < 0:
            char_after = self.GetCharAt(caret_pos)
            style_after = self.GetStyleAt(caret_pos)

            if char_after and chr(char_after) in "[]{}()" and \
               style_after == stc.STC_P_OPERATOR:
                brace_at_caret = caret_pos

        if brace_at_caret >= 0:
            brace_opposite = self.BraceMatch(brace_at_caret)

        if brace_at_caret != -1 and brace_opposite == -1:
            self.BraceBadLight(brace_at_caret)
        else:
            self.BraceHighlight(brace_at_caret, brace_opposite)
1103799
def on_key_pressed(self, event):
        

        return

        # TODO

        if event.keysym == "Up":
            self.manager.set_joystick(0.0, -1.0, 0)
        elif event.keysym == "Down":
            self.manager.set_joystick(0.0, 1.0, 0)
        elif event.keysym == "Left":
            self.manager.set_joystick(-1.0, 0.0, 0)
        elif event.keysym == "Right":
            self.manager.set_joystick(1.0, 0.0, 0)

        elif event.char == " ":
            mode = self.manager.get_mode()
            if mode == self.manager.MODE_DISABLED:
                self.manager.set_mode(self.manager.MODE_OPERATOR_CONTROL)
            else:
                self.manager.set_mode(self.manager.MODE_DISABLED)
357222
def update_tool_tip(self, service_running: bool):
        """"""
        if service_running:
            self.setToolTip(TOOLTIP_RUNNING)
        else:
            self.setToolTip(TOOLTIP_PAUSED)
1115027
def OnUpdate(self, event):
        """"""

        attributes = event.attr

        self._update_font(attributes["textfont"])
        self._update_pointsize(attributes["pointsize"])
        self._update_font_weight(attributes["fontweight"])
        self._update_font_style(attributes["fontstyle"])
        self._update_frozencell(attributes["frozen"])
        self._update_lockedcell(attributes["locked"])
        self._update_markupcell(attributes["markup"])
        self._update_underline(attributes["underline"])
        self._update_strikethrough(attributes["strikethrough"])
        self._update_justification(attributes["justification"])
        self._update_alignment(attributes["vertical_align"])
        self._update_fontcolor(attributes["textcolor"])
        self._update_merge(attributes["merge_area"] is not None)
        self._update_textrotation(attributes["angle"])
        self._update_bgbrush(attributes["bgcolor"])
        self._update_bordercolor(attributes["bordercolor_bottom"])
        self._update_borderwidth(attributes["borderwidth_bottom"])

        self.Refresh()

        event.Skip()
412446
def _update_lock_icon(self):
        """"""
        icon = ima.icon('lock') if self.locked else ima.icon('lock_open')
        self.locked_button.setIcon(icon)
        tip = _("Unlock") if self.locked else _("Lock")
        self.locked_button.setToolTip(tip)
280988
private void updateDecoration() {
        if (lastResult != null) {
            if (lastResult) {
                setIcon(validIcon);
                setToolTipText(validText);
            } else {
                setIcon(invalidIcon);
                setToolTipText(invalidText);
            }
        }
    }
1218032
function() {
            var options = this.getSelected();

            // First update the displayed button text.
            $('button', this.$container).html(this.options.buttonText(options, this.$select));

            // Now update the title attribute of the button.
            $('button', this.$container).attr('title', this.options.buttonTitle(options, this.$select));

        }
1151623
def add_keyup(self, actions, **kwargs):
        """"""
        return self.add_handler(pygame.KEYUP, actions, **kwargs)