Implement xterm mouse modes