def set_key(self, key, modifiers: typing.List[Key]=None):
if modifiers is None:<EOL><INDENT>modifiers = []  <EOL><DEDENT>if key in self.KEY_MAP:<EOL><INDENT>key = self.KEY_MAP[key]<EOL><DEDENT>self._setKeyLabel(key)<EOL>self.key = key<EOL>self.controlButton.setChecked(Key.CONTROL in modifiers)<EOL>self.altButton.setChecked(Key.ALT in modifiers)<EOL>self.shiftButton.setChecked(Key.SHIFT in modifiers)<EOL>self.superButton.setChecked(Key.SUPER in modifiers)<EOL>self.hyperButton.setChecked(Key.HYPER in modifiers)<EOL>self.metaButton.setChecked(Key.META in modifiers)<EOL>self.recording_finished.emit(True)<EOL>
This is called when the user successfully finishes recording a key combination.