Here is how to have the same hotkey to switch back and forth from code to terminal for maximum productivity:
{"key": "f1","command": "workbench.action.focusActiveEditorGroup","when": "terminalFocus" }, {"key": "f1","command": "workbench.action.terminal.focusNext","when": "!terminalFocus" },