in the init method the attribute key_hook is created and not used by the other hand its used an attribute called keyboard_hook that is not initialized, i belive that they are the same attribute but with different names, so i think its needed to change the key_hook for keyboard_hook or vise versa
Can confirm. This also causes an error when the object is deleted.