Added keys handling, improved ptr events handling, added reconnect ability