Reimplement Qt method to send focus change notification
768367
def focusInEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(ShellWidget, self).focusInEvent(event)
815465
def mousePressEvent(self, event):
        
        if event.button() == Qt.LeftButton:
            self.parent().actionTriggered.emit(self.action())
            self.parent().setSelectedAction(self.action())
        elif event.button() == Qt.MidButton:
            self.parent().actionMiddleTriggered.emit(self.action())
        elif event.button() == Qt.RightButton:
            self.parent().actionMenuRequested.emit(self.action(),
                                                   self.mapToParent(event.pos()))
        
        event.accept()
66887
def _on_key_pressed(self, event):
        
        if (int(event.modifiers()) & QtCore.Qt.ControlModifier > 0 and
                not int(event.modifiers()) & QtCore.Qt.ShiftModifier):
            if event.key() == QtCore.Qt.Key_0:
                self.editor.reset_zoom()
                event.accept()
            if event.key() == QtCore.Qt.Key_Plus:
                self.editor.zoom_in()
                event.accept()
            if event.key() == QtCore.Qt.Key_Minus:
                self.editor.zoom_out()
                event.accept()
884308
def keyPressEvent(self, event):
        """"""
        event, text, key, ctrl, shift = restore_keyevent(event)

        if key == Qt.Key_Slash and self.isVisible():
            self.show_find_widget.emit()
64052
def focusInEvent(self, event):
        """"""
        show_status = getattr(self.lineEdit(), 'show_status_icon', None)
        if show_status:
            show_status()
        QComboBox.focusInEvent(self, event)
1268856
def keyPressEvent(self, event):
        """"""
        key = event.key()
        if key == QtCore.Qt.Key_X:
            self.actionXref()
        elif key == QtCore.Qt.Key_G:
            self.actionGoto()
        elif key == QtCore.Qt.Key_X:
            self.actionXref()
        elif key == QtCore.Qt.Key_I:
            self.actionInfo()
        elif key == QtCore.Qt.Key_R:
            self.reload_java_sources()
1117933
def key_press_event(self, event):
        
        input_buffer = self._get_input_buffer()
        ctrl = int(event.modifiers() & QtCore.Qt.ControlModifier) != 0
        shift = int(event.modifiers() & QtCore.Qt.ShiftModifier) != 0
        delete = event.key() in [QtCore.Qt.Key_Backspace, QtCore.Qt.Key_Delete]
        ignore = False
        if delete and not input_buffer and not shift:
            return False
        if ctrl:
            if shift and event.key() == QtCore.Qt.Key_V:
                self.edit.insertPlainText(QtWidgets.qApp.clipboard().text())
                return False
            elif event.key() == QtCore.Qt.Key_L:
                self.edit.clear()
                if sys.platform == 'win32':
                    self.process.write(b'\r')
                self.process.write(b'\n')
                return False
        if (shift or ctrl) and event.key() == QtCore.Qt.Key_Backspace:
            if input_buffer.strip() != '':
                return True
            self._clear_user_buffer()
            return False
        if event.key() == QtCore.Qt.Key_Up:
            if self.is_code_completion_popup_visible():
                return True
            self._insert_command(self._history.scroll_up())
            return False
        if event.key() == QtCore.Qt.Key_Left:
            return bool(input_buffer)
        if event.key() == QtCore.Qt.Key_Down:
            if self.is_code_completion_popup_visible():
                return True
            self._insert_command(self._history.scroll_down())
            return False
        if event.key() == QtCore.Qt.Key_Home:
            tc = self.edit.textCursor()
            tc.movePosition(tc.StartOfBlock)
            tc.movePosition(tc.Right, tc.MoveAnchor, self.edit._formatter._prefix_len)
            self.edit.setTextCursor(tc)
            return False
        if event.key() == QtCore.Qt.Key_End:
            tc = self.edit.textCursor()
            tc.movePosition(tc.EndOfBlock)
            self.edit.setTextCursor(tc)
            self._cursor_pos = len(self._get_input_buffer())
            return False
        if event.key() in [QtCore.Qt.Key_Return, QtCore.Qt.Key_Enter]:
            if self.is_code_completion_popup_visible():
                return True
            tc = self.edit.textCursor()
            tc.movePosition(tc.EndOfBlock)
            self.edit.setTextCursor(tc)
            # send the user input to the child process
            if self.edit.flg_use_pty or 'cmd.exe' in self.process.program():
                # remove user buffer from text edit, the content of the buffer will be
                # drawn as soon as we write it to the process stdin
                tc = self.edit.textCursor()
                for _ in input_buffer:
                    tc.deletePreviousChar()
                self.edit.setTextCursor(tc)
            self._history.add_command(input_buffer)
            if sys.platform == 'win32':
                input_buffer += "\r"
            input_buffer += "\n"
            self.process.write(input_buffer.encode())
            if self.edit.flg_use_pty or 'cmd.exe' in self.process.program():
                ignore = True
        return not ignore
210632
function clickSendMessage() {
    var currentText = $('#message_text').val().trim();

    if (!currentText.length) {
        return;
    }

    $('#message_text').val('').focus();

    sendMessage(currentText, null);
}
536608
def focusInEvent(self, event):
        
        self.focused_in.emit(event)
        super(CodeEdit, self).focusInEvent(event)
648876
def _qteMouseClicked(self, widgetObj):
        

        # ------------------------------------------------------------
        # The following cases for widgetObj have to be distinguished:
        #   1: not part of the Qtmacs widget hierarchy
        #   2: part of the Qtmacs widget hierarchy but not registered
        #   3: registered with Qtmacs and an applet
        #   4: registered with Qtmacs and anything but an applet
        # ------------------------------------------------------------

        # Case 1: return immediately if widgetObj is not part of the
        # Qtmacs widget hierarchy; otherwise, declare the applet
        # containing the widgetObj active.
        app = qteGetAppletFromWidget(widgetObj)
        if app is None:
            return
        else:
            self._qteActiveApplet = app

        # Case 2: unregistered widgets are activated immediately.
        if not hasattr(widgetObj, '_qteAdmin'):
            self._qteActiveApplet.qteMakeWidgetActive(widgetObj)
        else:
            if app._qteAdmin.isQtmacsApplet:
                # Case 3: widgetObj is a QtmacsApplet instance; do not
                # focus any of its widgets as the focus manager will
                # take care of it.
                self._qteActiveApplet.qteMakeWidgetActive(None)
            else:
                # Case 4: widgetObj was registered with qteAddWidget
                # and can thus be focused directly.
                self._qteActiveApplet.qteMakeWidgetActive(widgetObj)

        # Trigger the focus manager.
        self._qteFocusManager()
1284508
def keyPressEvent(self, event):
        """"""
        event_key = event.key()
        if not event_key or event_key == Qt.Key_unknown:
            return
        if len(self._qsequences) == 4:
            # QKeySequence accepts a maximum of 4 different sequences.
            return
        if event_key in [Qt.Key_Control, Qt.Key_Shift,
                         Qt.Key_Alt, Qt.Key_Meta]:
            # The event corresponds to just and only a special key.
            return

        translator = ShortcutTranslator()
        event_keyseq = translator.keyevent_to_keyseq(event)
        event_keystr = event_keyseq.toString(QKeySequence.PortableText)
        self._qsequences.append(event_keystr)
        self.update_warning()
1083901
def mousePressEvent(self, event):
        """"""
        # Raise the main application window on click
        self.parent.raise_()
        self.raise_()

        if event.button() == Qt.RightButton:
            pass
160883
private void notifyWidgetsOfOpen() {

        for (Map.Entry<String, I_CmsFormField> fieldEntry : m_propertyEditor.getForm().getFields().entrySet()) {
            fieldEntry.getValue().getWidget().setAutoHideParent(this);
        }
    }
880759
def eventFilter(self, widget, event):
        
        if event.type() == QEvent.KeyPress:
            key = event.key()
            shift = event.modifiers() & Qt.ShiftModifier

            if key == Qt.Key_Return:
                if shift:
                    self.return_shift_pressed.emit()
                else:
                    self.return_pressed.emit()

            if key == Qt.Key_Tab:
                if self.search_text.hasFocus():
                    self.replace_text.set_current_text(
                        self.search_text.currentText())
                self.focusNextChild()

        return super(FindReplace, self).eventFilter(widget, event)
1281941
def keyPressEvent( self, event ):
        
        if ( self.scrollWidget().isHidden() ):
            if ( event.key() == Qt.Key_Escape ):
                self.cancelEdit()
                return
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return
            
        elif ( event.key() == Qt.Key_A and 
               event.modifiers() == Qt.ControlModifier ):
            self.startEdit()
        
        super(XNavigationEdit, self).keyPressEvent(event)
417799
def enterEvent(self, event):
        
        super(CallTipWidget, self).enterEvent(event)
        if self.as_tooltip:
            self.hide()

        if (self._hide_timer.isActive() and
          self.app.topLevelAt(QCursor.pos()) == self):
            self._hide_timer.stop()
1337539
def keyPressEvent(self, event):
        
        if event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter:
            if self.add_current_text_if_valid():
                self.selected()
                self.hide_completer()
        elif event.key() == Qt.Key_Escape:
            self.set_current_text(self.selected_text)
            self.hide_completer()
        else:
            QComboBox.keyPressEvent(self, event)