<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def key_changed(self):
 """Checks if the key name and value fields have been set, and updates the add key button"""

        if self.key_name.get() and self.key_val.get():
            self.button_key_add.state(["!disabled"])
        else:
            self.button_key_add.state(["disabled"])