Pure Python keyboard hook for recording KeyPress and KeyRelease events via Python XLib wrapper.