Prevent stock keyboard app from being activated while/after connecting physical keyboard?


Question

I have a Samsung I9305 with rooted stock 4.4.4.. I have Xposed framework.



I use SwiftKey.



When I use a Bluetooth or OTG keyboard, SwiftKey is automatically disabled and the stock keyboard is enabled.



Is it possible to




  1. Prevent the change of keyboard and have SwiftKey continue even while using the physical keyboard?


  2. At least make the system automatically change back to SwiftKey after the physical keyboard is disconnected?



Answer

I used Root App Deleter to disable the stock keyboard app. That way I just keep using SwiftKey whether using physical keyboard or not.



Note: SwiftKey only lets me use the English layout when using a physical keyboard. I normally type in both English and Norwegian, and like to switch between layouts. The Samsung stock keyboard let me easily do this by pressing alt+Shift. As far as I can see, Swiftkey has me locked onto English layout when using a physical keyboard. If you want to be able to switch between different layouts, you will be better off using the Tasker method suggested by Izzy.



With SwiftKey, the soft keyboard disappears from the screen as soon as the physical keyboard is connected. One catch is that there is annoying message I have to click OK to every time I connect the physical keyboard, but that is okay. It just amounts to a simple press of the Enter key.



Warnings:




  • This method worked on my particular device and ROM, but there is no guarantee that it will work on other devices and/or ROMs. The app I linked to above requires root. Do NOT delete the stock keyboard app of your device, just disable it. Even disabling the stock keyboard app of your device may in some rare devices and ROMs cause the system to misbehave. If that happens to you you can use the same app to reenable the stock keyboard app again, and use the Tasker method suggested by Izzy in the comments instead.

  • A very small number of Android ROMs may be unable to reenable apps after having disabled them with this app. The app has a test module that you should run before disabling any apps, to make sure that reenabling them again will work.

  • With the OS default keyboard unavailable, there might be issues with lock screen (enter password/pin) as well as encryption (same thing), which might rely on the "stock keyboard". Such cases already have been reported here – see e.g. How to enter password for decrypt without system keyboard on android. Especially for the encryption password, this is a logical consequence: the user-installed keyboard app is stored on the user partition (/data), which is encrypted – so the keyboard cannot be loaded before that partition is decrypted, which requires the user to enter the passphrase; a typical dead-lock situation..

  • In general, use this (and all other) root apps at your own risk, and backup your system with / regularly if you have a rooted device and use root-applications.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes