Fixed keypress callbacks setup on connection
Fixed PEP8