I have not tried it myself, but this should be possible using Tasker with the Secure Settings Plugin and, optionally, one of the NFC Plugins available:
Secure Settings offers an "Input Method" action in its "System+" actions, to switch between input methods (which include keyboard apps). As for triggering that action, you can use any of Tasker's (or one of its plugins') conditions. Tasker itself has such a "NFC Status" action, but those mentioned NFC plugins might offer more flexibility.
Tasker is the most comprehensive automation solution for Android, combining "conditions" with "tasks" to "profiles". For your use-case, a "Switch Input Method" profile would consist of something like this:
- Condition: State › Net › NFC Status (configure accordingly)
- Task: Actions › Plugin › Secure Settings, and there System+ › Input Method (configure accordingly)
With that set up, scanning the configured NFC tag should toggle your input method.
Note that Tasker costs about USD 5 – but it's definitely worth every cent. I'm using Tasker for years, and don't want to do without anymore. There's a free 7-day-trial available on their homepage – and the dev even states himself you can easily extend those 7 days for another 7 days: Export your configuration, uninstall Tasker, re-install it, import your settings. Nothing for the long-run (you should definitely buy it then) – but good if you're still undecided.
For more details on Tasker, please take a look at
- the tasker tag-wiki at our sister-site of Android Enthusiasts
- my comprehensive list of Tasker Resources, listing all kind of plugins (grouped by topics) as well as tutorials and more