jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.26k stars 319 forks source link

key (and other slide change) command don't work any more for Libreoffice 6 Impress/Raspbian Buster 32-bit (works on LO 5/Raspbian Stretch) running on Raspberry Pi 3B+ #269

Open pamodeo-icb opened 4 years ago

pamodeo-icb commented 4 years ago

Hi, not sure if the issue in mainly due to xdotool, LibreOffice or Debian, but I can't test at present different combinations of OS, LO and Debian distribution. On a Raspberry Pi 3B+ running Raspbian Buster, while I can move a window running a LO 6 Impress presentation, all the xdotool commands aimed at changing slides, like key and click, issued either from another terminal window, or from a python program (by the os.system(cmd) call) do nothing, issuing no error. The same commands and programs run flawlessly on the same HW platform, under Raspbian Stretch (featuring LibreOffice 5). Please, let me know if I can try anything or provide any other info to help understanding and possibly fixing this strange behavior. Best regards.

jordansissel commented 4 years ago

Interesting. Can you share a sample command? I will try to load raspbian buster and see if I can reproduce.

On Sun, Dec 1, 2019 at 4:06 PM pamodeo-icb notifications@github.com wrote:

Hi, not sure if the issue in mainly due to xdotool, LibreOffice or Debian, but I can't test at present different combinations of OS, LO and Debian distribution. On a Raspberry Pi 3B+ running Raspbian Buster, while I can move a window running a LO 6 Impress presentation, all the xdotool commands aimed at changing slides, like key and click, issued either from another terminal window, or from a python program (by the os.system(cmd) call) do nothing, issuing no error. The same commands and programs run flawlessly on the same HW platform, under Raspbian Stretch (featuring LibreOffice 5). Please, let me know if I can try anything or provide any other info to help understanding and possibly fixing this strange behavior. Best regards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jordansissel/xdotool/issues/269?email_source=notifications&email_token=AABAF2TKK6VR34VXT77UCHDQWRGPTA5CNFSM4JTOOPGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5DWJRQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2Q63AJPAY5RBOTUQPTQWRGPTANCNFSM4JTOOPGA .

pamodeo-icb commented 4 years ago

Thank you for your quick reply. An example of the slide presentation code of my python programs is:

pres_file = "/.odp" os.spawnlp(os.P_NOWAIT, "libreoffice","--nologo","--show",pres_file) ... ... code defining a string variable "si" containing the sequence of numbers (space separated) corresponding to the slide number ... cmd = "xdotool search --name 'Impress' key " + si + " Return" os.system(cmd)

but the same problem occurs when simply issuing the command: xdotool search --name 'Impress' key Return

where is obviously the slide number, in a terminal window. Also the click command doesn't produce any effect (but I never tested it under the Stretch/LO5 configuration), as well as providing the process number instead of the "search" option. However, the problem shouldn't be related to window identification, since if I send commands to displace the window (sorry, I haven't the devices handy at moment, to reproduce the exact command line, but I'll try later on both of them), they work flawlessly under Buster/LO6. The xdotool, OS and LO versions are the Raspbian standard ones (plus updates).

jordansissel commented 4 years ago

My first thought is what the xdotool docs talk about as "XSendEvent" and "XTEST".

Your command I believe is using XSendEvent to simulate keyboard events. Some applications detect this and ignore these kind of simulated events.

You can tell xdotool to use XTEST instead. XTEST is a way to simulate keyboard input but it would usually send events to the currently active window. You may need to make this window active first.

You might have success doing this:

xdotool search --name 'Impress' windowactivate key --window 0 key1 key2 key3 Return

In your python code example, this may look like this:

cmd = "xdotool search --name 'Impress' windowactivate key --window 0 " + si + " Return"
pamodeo-icb commented 4 years ago

Both commands (in terminal: xdotool search --name 'Impress' windowactivate key --window 0 key1 key2 key3 Return and in python program: cmd = "xdotool search --name 'Impress' windowactivate key --window 0 " + si + " Return" issued in a test program) now work!

Tomorrow I will perform more extensive testing under realistic application conditions. Thanks a lot!

jordansissel commented 4 years ago

Wonderful! I am glad this worked for you :)

On Tue, Dec 3, 2019 at 1:42 PM pamodeo-icb notifications@github.com wrote:

Both commands (in terminal: xdotool search --name 'Impress' windowactivate key --window 0 key1 key2 key3 Return and in python program: cmd = "xdotool search --name 'Impress' windowactivate key --window 0 " + si + " Return" issued in a test program) now work!

Tomorrow I will perform more extensive testing under realistic application conditions. Thanks a lot!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/jordansissel/xdotool/issues/269?email_source=notifications&email_token=AABAF2VKSZEG4VPSU7J5Q23QW3HF7A5CNFSM4JTOOPGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF25HZI#issuecomment-561370085, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2RJXWPPQVBVSIPJSM3QW3HF7ANCNFSM4JTOOPGA .