Python PyQt5.QtCore.Qt.Key_F5() Examples

The following are 3 code examples of PyQt5.QtCore.Qt.Key_F5(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore.Qt , or try the search function .
Example #1
Source File: reviewer.py    From awesometts-anki-addon with GNU General Public License v3.0 5 votes vote down vote up
def key_handler(self, key_event, state, card, replay_audio):
        """
        Examines the key event to see if the user has triggered one of
        the shortcut options.

        If we do not handle the key here, then it is passed through to
        the normal Anki Reviewer implementation.

        As a special case, if the user sets his/her shortcut to one of
        the built-in audio shorts (i.e. R, F5), will play ALL sounds,
        starting with the built-in ones.
        """

        if state not in ['answer', 'question']:
            return False

        combo = key_event_combo(key_event)
        if not combo:
            return False

        handled = False

        if combo in [Qt.Key_R, Qt.Key_F5]:
            replay_audio()
            handled = True

        question_combo = self._addon.config['tts_key_q']
        if question_combo and combo == question_combo:
            self._play_html('front', card.q(),
                            self._addon.player.otf_shortcut, self._mw)
            handled = True

        answer_combo = self._addon.config['tts_key_a']
        if state == 'answer' and answer_combo and combo == answer_combo:
            self._play_html('back', self._get_answer(card),
                            self._addon.player.otf_shortcut, self._mw)
            handled = True

        return handled 
Example #2
Source File: gui.py    From lanzou-gui with MIT License 5 votes vote down vote up
def keyPressEvent(self, e):
        if e.key() == Qt.Key_A:  # Ctrl/Alt + A 全选
            if e.modifiers() and Qt.ControlModifier:
                self.select_all_btn()
        elif e.key() == Qt.Key_F5:  # 刷新
            self.call_change_tab() 
Example #3
Source File: session.py    From Dwarf with GNU General Public License v3.0 5 votes vote down vote up
def _setup_menu(self):
        """ Build Menus
        """
        process_menu = QMenu('&Process')
        process_menu.addAction('Resume', self._on_proc_resume, Qt.Key_F5)
        process_menu.addAction('Restart', self._on_proc_restart, Qt.Key_F9)
        process_menu.addAction('Detach', self._on_detach, Qt.Key_F10)

        process_menu.addSeparator()
        process_menu.addAction('Step', lambda: self.dwarf.dwarf_api('_step'), Qt.Key_F7)
        process_menu.addAction('Step call', lambda: self.dwarf.dwarf_api('_step', 'call'), Qt.Key_F8)
        process_menu.addAction('Step block', lambda: self.dwarf.dwarf_api('_step', 'block'))

        self._menu.append(process_menu)