Fixed parameter names
Implemented character input detection for X11