當前位置: 首頁>>代碼示例>>Python>>正文


Python Window.request_keyboard方法代碼示例

本文整理匯總了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() 
開發者ID:MaslowCNC,項目名稱:GroundControl,代碼行數:21,代碼來源:gcodeCanvas.py

示例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) 
開發者ID:snuq,項目名稱:Snu-Photo-Manager,代碼行數:11,代碼來源:generalelements.py

示例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) 
開發者ID:deepdiy,項目名稱:deepdiy,代碼行數:8,代碼來源:hotkey.py

示例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) 
開發者ID:undercase,項目名稱:FlappyKivy,代碼行數:8,代碼來源:FlappyBird.py


注:本文中的kivy.core.window.Window.request_keyboard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。