本文整理汇总了Python中Actions.handle_key_press方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.handle_key_press方法的具体用法?Python Actions.handle_key_press怎么用?Python Actions.handle_key_press使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions.handle_key_press方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _handle_key_press
# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import handle_key_press [as 别名]
def _handle_key_press(self, widget, event):
"""
Handle key presses from the keyboard and translate key combinations into actions.
This key press handler is called prior to the gtk key press handler.
This handler bypasses built in accelerator key handling when in focus because
* some keys are ignored by the accelerators like the direction keys,
* some keys are not registered to any accelerators but are still used.
When not in focus, gtk and the accelerators handle the the key press.
@return false to let gtk handle the key action
"""
if not self.get_focus_flag(): return False
return Actions.handle_key_press(event)
示例2: _handle_key_press
# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import handle_key_press [as 别名]
def _handle_key_press(self, widget, event):
"""
Handle key presses from the keyboard and translate key combinations into actions.
This key press handler is called prior to the gtk key press handler.
This handler bypasses built in accelerator key handling when in focus because
* some keys are ignored by the accelerators like the direction keys,
* some keys are not registered to any accelerators but are still used.
When not in focus, gtk and the accelerators handle the the key press.
Returns:
false to let gtk handle the key action
"""
# prevent key event stealing while the search box is active
if self.main_window.btwin.search_entry.has_focus(): return False
if not self.get_focus_flag(): return False
return Actions.handle_key_press(event)