use register_handlers for key events