本文整理匯總了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)