I'd somewhat narrowed the behaviour to any 'messaging' system - slack, skype, messages and some others - if I switched to slack or responded to an osx 'messages' notice, my keystrokes would also be sent to the Workspace, and generally cause havoc. I'd leave an IDE open, switch to slack to talk to the client, come back, and all the code was replaced with our conversation.
There seemed to be reports of some similar behaviour with a windows client last year, and it was supposed to be 'fixed', but I never saw any reports of similar OSX behaviour.