1 Answer
1

The only way I know how to do this is to have an applescript "stay open" in the background and detect the application launch/quit.

I used a technique like this to answer this question about disabling growl while VLC is open. You could adapt it to your situation by detecting if Starcraft is open. When you see it is no longer running, switch the keyboard layout and then quit the applescript.