Assigning a keyboard to a specific app Sierra
I don't think that it's possible to type into an application that is in the background. The keyboard will type into whichever application or document is frontmost. 
The keyboard shortcut cmd + tab allows you to cycle between the open applications in a left to right order. If you keep a lot of applications open simultaneously and the unidirectional cycling is unpractical, cmd + shift + tab allows to cycle backwards too.