copy and paste from/to clipboard, and switch pate modes