How to change keyboard setting when app changes
Since you mentioned that you could use 3rd party apps you should have a look at Keyboard Maestro, allowing you to create macros and triggers. For example you could have Keyboard Maestro switch to the Dvorak keyboard whenever you are using Type Fu.

Here is how I would go about this:


Create a new Macro called "Switch to Dvorak".
Pick "Application" trigger and select Type Fu.
Select "Set keyboard Layout" Action.