Android: changing the keyboard with a trigger?
December 3, 2017 7:18 AM   Subscribe

I love Swype. However, it has a bug that when I connect a Bluetooth keyboard to my phone, the shift key of the physical keyboard isn't recognized. When I change from Swype to GBoard or any other keyboard, the BT keyboard works as expected. Is there a way to make my phone switch from Swype to GBoard when I turn on my BT keyboard and then back to Swype when I disconnect the physical keyboard? (Not looking for pitches for SwiftKey or other Swype alternatives.) Thanks!
posted by dobbs to Technology (7 answers total)
 
I'm on a Note 8 if that makes any difference.
posted by dobbs at 7:20 AM on December 3, 2017


Your question got me looking for scripting tools for Android. Automate seems to have support for reacting to Bluetooth events (connect and disconnect), and input method set, maybe that's enough.
posted by askmehow at 8:11 AM on December 3, 2017


You can do this with Tasker. Rather than a plug-in as described in the article, you can also use a shell command (settings put secure default_input_method keyboard.package.name.here/.IMENameHere).

However, bear in mind that changing the input method programmatically requires a rooted phone.
posted by kindall at 8:17 AM on December 3, 2017


Ahh, @kindall has it, the phone needs to be rooted in order to use the set input method in automate.
posted by askmehow at 8:31 AM on December 3, 2017


You might be able to do it without root using Tasker and the AutoInput plug-in, but the keyboard selection dialog is going to appear.
posted by kindall at 9:27 AM on December 3, 2017


Luckily, if Swype obeys the setting for showing the input switcher on the keyboard a single tap of the globe icon will switch to your most recently used keyboard and back again.

Otherwise you will need to root your phone or live with Gboard's gesture typing. (Or a recent AOSP keyboard, which also does gesture typing) Android intentionally makes it impossible for an app to select a new input method from the selection dialog. They can show the dialog, but that's it unless your phone is rooted and the app has root privs. It prevents apps from installing a fake input method with a keylogger and then forcing you to use it.
posted by wierdo at 10:13 AM on December 3, 2017


It occurs to me that if Tasker or Automate can toggle the input method like the keyboards do, that may be doable without root and would be sufficient for your purpose.
posted by wierdo at 10:18 AM on December 3, 2017


« Older How long can roaches (or their eggs) survive...   |   Help me find Marina's large black disc earrings in... Newer »
This thread is closed to new comments.