From 82bb58a97f54a59d82f243e138efec45376c60d7 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 19 Oct 2018 18:48:42 -0400 Subject: [PATCH] Used new Find Element with Focus. Was able to change 1 ReadNonBlocking into read with timeout --- Demo_Touch_Keyboard2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Demo_Touch_Keyboard2.py b/Demo_Touch_Keyboard2.py index f9183266..ece6107f 100644 --- a/Demo_Touch_Keyboard2.py +++ b/Demo_Touch_Keyboard2.py @@ -61,8 +61,8 @@ class keyboard(): class GUI(): def __init__(self): layout = [[sg.Text('Enter Text')], - [sg.Input(size=(17, 1), key='input1', )], - [sg.InputText(size=(17, 1), key='input2')], + [sg.Input(size=(17, 1), key='input1', do_not_clear=True )], + [sg.InputText(size=(17, 1), key='input2', do_not_clear=True)], [sg.ReadButton('on-screen keyboard', key='keyboard')], [sg.ReadButton('close', key='close')]] @@ -75,7 +75,7 @@ class GUI(): cur_focus = self.mainWindow.FindElementWithFocus() if cur_focus is not None: self.focus = cur_focus - event, values = self.mainWindow.ReadNonBlocking() + event, values = self.mainWindow.Read(timeout=200, timeout_key='timeout') if self.focus is not None: self.keyboard.update(self.focus) if event == 'keyboard':