Mostly work on keysym handling. Pinched from other projects.