Hi,

On 23/04/2017 16:29, Kornel Benko wrote:
\Cq\[Escape]

can't remember why I had the window name explicit in keytest. Do you mind
trying out the attached one, that removes that ?

The window name forces keys to be sent to the main LyX window, so whenever
there's a dialog, keytest.py fails to send the key to the dialog, so it's
impossible to dismiss it or anything. Leaving out that parameter, it seems
now keys reach the right window with focus within the process.

Also, I'm trying again to close tests with

  \Cq\[Tab]\[Enter]

which chooses the middle "Discard" button in case a dialog asking to save
shows up.

Thanks,

        T.
diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index 97166847..361d4079 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -241,7 +241,8 @@ def sendKeystring(keystr, LYX_PID):
         xvpar.extend(["-xsendevent"])
     if xvkbd_hacked:
         xvpar.extend(["-wait_idle", lyx_pid])
-    xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
+#    xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
+    xvpar.extend(["-delay", actual_delay, "-text", keystr])
     
     subprocess.call(xvpar, stdout = FNULL, stderr = FNULL)
 
@@ -441,7 +442,7 @@ while not failed:
 	    sendKeystring("\Ax\[Escape]", lyx_pid)
 	    # now we should be outside any dialog
 	    # and so the function lyx-quit should work
-            sendKeystring("\Cq", lyx_pid)
+            sendKeystring("\Cq\[Tab]\[Enter]", lyx_pid)
             time.sleep(0.5)
             if lyx_sleeping():
                 # probably waiting for Save/Discard/Abort, we select 'Discard'

Reply via email to