Bug with Automate Accessibility Service and external keyboard

222 views
Skip to first unread message

Karsten

unread,
Feb 17, 2021, 2:33:15 PM2/17/21
to Automate
Hi,
I found the following problem (which caused me quite some hours and a complete re-install to identify):

- I have a Galaxy Tab S7+ with the original keyboard cover
- the keyboard is German layout, the whole system is set to German language
- as soon as I activate the Automate service under accessibility, it corrupts the input from the external keyboard: it simply causes all input to be as if I had a US keyboard connected

The moment I disable the service, everything is fine again and the keyboard works as it should.

This only affects input via the (externa) physical keyboard and does not affect the on-screen keyboard at all.

Please, please find a fix for this - it renders Automate entirely unusable for me. I am happy to help with testing / debugging if I can.

Thanks,
Karsten

Henrik "The Developer" Lindqvist

unread,
Feb 17, 2021, 9:32:27 PM2/17/21
to Automate
Must be an Android bug/feature, an AccessibilityService can't modify key events, only filter them, see:

Are you sure it's the Accessibility service you're enabling, not the Automate keyboard (service)?

If you look in system Settings, System, Languages & input, does it actually change Language somewhere?

Karsten Ballueder

unread,
Feb 18, 2021, 3:10:51 AM2/18/21
to automa...@googlegroups.com
Hi Henrik,

thanks for the speedy reply!

I agree with your reading of the docs - looks like the service shouldn't be able to modify the event at all.

I also tested with an external USB keyboard and found the same behaviour, so it's not specific to the physical Samsung keyboard.

I also recorded a little screen video to show you what happens - I am typing the same three keys, without/with/without the Automate service running. I'll send that in a separate email as it's a little large.

After playing around a little more I managed to create a situation where the "bug"was turned on permanently even after disabling the Automate service. I was able to resolve it by removing additional input languages for the Samsung keyboard. Then, turning on Automate service again, it was broken again. However, leaving the Automate service off, I was able to re-enable additional languages and everything works fine. But it hints at some weird interaction between your service and the Samsung keyboard (which cannot be disabled for the cover keyboard).

I'll try and do some more testing - also on a non-Samsung device.

If you would like me to test a modified service, just let me know. Maybe your code could make a copy of the event data itself to prevent modifying it or just not touch it at all (just for testing). Happy to help in any way I can.

Best regards,
Karsten



--
You received this message because you are subscribed to a topic in the Google Groups "Automate" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automate-user/Txt0LLmf5Dw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/3cfff376-5b42-49f0-9b37-598ecee35619n%40googlegroups.com.

Henrik "The Developer" Lindqvist

unread,
Feb 18, 2021, 3:37:09 PM2/18/21
to Automate
In system Settings, System, Languages & input, try changing the Virtual and/or Physical keyboard, if possible.

I don't think there's much i can change in my code, except implementing some kind of workaround, if we can find any.

Karsten Ballueder

unread,
Feb 19, 2021, 2:55:58 AM2/19/21
to automa...@googlegroups.com
I had already tried that. Changing languages/layout makes no difference and I cannot switch the keyboard for the external one as it is hard-wired to use the "Samsung Keyboard".
Now, this should be different for external USB or Bluetooth keyboard. I will test this out over the weekend and see if it is different, also with non-Samsung devices.
I also once managed to get this change to stick around after disabling the Automate service, but could immediately resolve it by removing additional languages and re-adding them. Other than that one occurrence it is 100% reliable: works fine with Automate services off, gets broken when I turn it on and is fine again after turning it off.

I don't know your code or what it does, but if I speculate about possible workarounds, I would see if the event data gets modified anywhere and try to work with copies of the data instead. If you want to send me a modified version (maybe even with some functionality disabled, just to try to narrow it down), I am happy to install and test for you. I really like Automate, so happy to contribute however I can.

BTW, I use the service to detect which app is running in the foreground (switch audio depending on app usage). 



--

Henrik "The Developer" Lindqvist

unread,
Feb 19, 2021, 10:43:43 PM2/19/21
to Automate
We can do a few test, email me at in...@llamalab.com
Reply all
Reply to author
Forward
0 new messages