![]() Otherwise, it will be used by # the system. release () # Return True to accept the key. _keyboard = None def _on_keyboard_down ( self, keyboard, keycode, text, modifiers ): print ( 'The key', keycode, 'have been pressed' ) print ( ' - text is %r ' % text ) print ( ' - modifiers are %r ' % modifiers ) # Keycode is composed of an integer + a string # If we hit escape, release the keyboard if keycode = 'escape' : keyboard. _on_keyboard_down ) def _keyboard_closed ( self ): print ( 'My keyboard have been closed!' ) self. widget : # If it exists, this widget is a VKeyboard object which you can use # to change the keyboard layout. _keyboard_closed, self, 'text' ) if self. require ( '1.0.8' ) from import Window from import Widget class MyKeyboardListener ( Widget ): def _init_ ( self, ** kwargs ): super ( MyKeyboardListener, self ). Here is an example of how to request a Keyboard in accordance with the Events : on_key_down: keycode, text, modifiersįired when a new key is pressed down on_key_up: keycode (system or virtual keyboard), you’ll receive events through this Per application: please don’t try to create more than one.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |