start working on client support: add encode() methods for pointer, keyboard and cut-text events