#NEWLINE# def _key_changed( self , event ) : #NEWLINE# #INDENT# ' Handles a keyboard event.\n        ' #NEWLINE# binding = self . object #NEWLINE# key_name = key_event_to_name ( event ) #NEWLINE# cur_binding = binding . owner . key_binding_for ( key_name , key_name ) #NEWLINE# if ( cur_binding is not None ) : #NEWLINE# #INDENT# if ( QtGui . QMessageBox . question ( self . control , 'Duplicate Key Definition' , ( "'%s' has already been assigned to '%s'.\nDo you wish to continue?" % ( key_name , cur_binding . description ) ) , ( QtGui . QMessageBox . Yes | QtGui . QMessageBox . No ) , QtGui . QMessageBox . No ) != QtGui . QMessageBox . Yes ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# self . value = key_name