当前位置: 首页>>代码示例>>Python>>正文


Python Qt.Key_F5方法代码示例

本文整理汇总了Python中PyQt5.QtCore.Qt.Key_F5方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Key_F5方法的具体用法?Python Qt.Key_F5怎么用?Python Qt.Key_F5使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.Qt的用法示例。


在下文中一共展示了Qt.Key_F5方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: key_handler

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_F5 [as 别名]
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 
开发者ID:AwesomeTTS,项目名称:awesometts-anki-addon,代码行数:41,代码来源:reviewer.py

示例2: keyPressEvent

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_F5 [as 别名]
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() 
开发者ID:rachpt,项目名称:lanzou-gui,代码行数:8,代码来源:gui.py

示例3: _setup_menu

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_F5 [as 别名]
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) 
开发者ID:iGio90,项目名称:Dwarf,代码行数:16,代码来源:session.py


注:本文中的PyQt5.QtCore.Qt.Key_F5方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。