Created
March 28, 2018 18:25
-
-
Save cruor99/d004c70ecdc1adff3016a479b92c4be5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.uix.textinput import TextInput | |
from kivy.clock import Clock | |
class Test(App): | |
def build(self): | |
self.ti = TextInput() | |
self.ti.bind(text=self.format) | |
return self.ti | |
def format(self, *args): | |
text = self.ti.text | |
if text: | |
if text[-1] == 'A': | |
self.ti.text = text + '-' | |
Clock.schedule_once(self.move_cursor, 1) | |
def move_cursor(self, *args): | |
print("Moved Cursor") | |
self.ti.do_cursor_movement('cursor_right') | |
Test().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment