simplified add_key_handler