Indeed you had them backward
So, just to be correct for other people reading this :
When swimming use the letter z to go down, the space bar to go up. You can use them together with the arrow keys. And can tap the Ctrl key to swim faster, tap the Ctrl key again to swim slower.
Instead of clicking outside the chatbox, you also can use the Enter key in an empty chat line. Same result. Enter key again brings the cursor back in the chat line. And you can use the Tab key to switch from one chat tab to the next one.