Python kivy.core.window.Window.request_keyboard() Examples

The following are 4 code examples of kivy.core.window.Window.request_keyboard(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module kivy.core.window.Window , or try the search function .
Example #1
Source File: gcodeCanvas.py    From GroundControl with GNU General Public License v3.0 6 votes vote down vote up
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() 
Example #2
Source File: generalelements.py    From Snu-Photo-Manager with GNU Lesser General Public License v3.0 5 votes vote down vote up
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) 
Example #3
Source File: hotkey.py    From deepdiy with MIT License 5 votes vote down vote up
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) 
Example #4
Source File: FlappyBird.py    From FlappyKivy with MIT License 5 votes vote down vote up
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)