本文整理汇总了Python中kivy.core.window.Window.request_keyboard方法的典型用法代码示例。如果您正苦于以下问题:Python Window.request_keyboard方法的具体用法?Python Window.request_keyboard怎么用?Python Window.request_keyboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.core.window.Window
的用法示例。
在下文中一共展示了Window.request_keyboard方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from kivy.core.window import Window [as 别名]
# 或者: from kivy.core.window.Window import request_keyboard [as 别名]
def initialize(self):
self.targetIndicator.color = self.data.targetInicatorColor
self.positionIndicator.color = self.data.posIndicatorColor
self.drawWorkspace()
if self.data.config.getboolean('Ground Control Settings', 'centerCanvasOnResize'):
Window.bind(on_resize = self.centerCanvas)
self.data.bind(gcode = self.updateGcode)
self.data.bind(backgroundRedraw = self.reloadGcode)
self.data.bind(gcodeShift = self.reloadGcode) #No need to reload if the origin is changed, just clear and redraw
self.data.bind(gcodeFile = self.centerCanvasAndReloadGcode)
global_variables._keyboard = Window.request_keyboard(self._keyboard_closed, self)
global_variables._keyboard.bind(on_key_down=self._on_keyboard_down)
self.centerCanvasAndReloadGcode()
示例2: __init__
# 需要导入模块: from kivy.core.window import Window [as 别名]
# 或者: from kivy.core.window.Window import request_keyboard [as 别名]
def __init__(self, **kwargs):
""" Use the initialize method to bind to the keyboard to enable
keyboard interaction e.g. using shift and control for multi-select.
"""
super(SelectableRecycleLayout, self).__init__(**kwargs)
if str(platform) in ('linux', 'win', 'macosx'):
keyboard = Window.request_keyboard(None, self)
keyboard.bind(on_key_down=self.select_with_key_down, on_key_up=self.select_with_key_up)
示例3: add_binding
# 需要导入模块: from kivy.core.window import Window [as 别名]
# 或者: from kivy.core.window.Window import request_keyboard [as 别名]
def add_binding(self,*args):
self._keyboard = Window.request_keyboard(
self._keyboard_closed, self, 'text')
self._keyboard.bind(on_key_down=self._on_keyboard_down,on_key_up=self._on_keyboard_up)
self.bind(keycode=self.trigger_hotkey)
self.bind(modifiers=self.trigger_hotkey)
示例4: __init__
# 需要导入模块: from kivy.core.window import Window [as 别名]
# 或者: from kivy.core.window.Window import request_keyboard [as 别名]
def __init__(self, **kwargs):
super(Mcnay, self).__init__(**kwargs)
if Config.getdefault('input', 'keyboard', False):
self._keyboard = Window.request_keyboard(
self._keyboard_closed, self, 'text')
self._keyboard.bind(on_key_down=self._on_keyboard_down)