Show
Ignore:
Timestamp:
01/04/07 03:18:42 (5 years ago)
Author:
mg
Message:

Bugfix: after remapping the controls the old keys used to continue to
perform the same actions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pyspacewar/ui.py

    r231 r232  
    21502150        """Change a key mapping""" 
    21512151        if key in self.rev_controls: 
     2152            # key was previously bound to something else 
    21522153            old_action = self.rev_controls[key] 
    21532154            self.controls[old_action] = None 
     2155        old_key = self.controls[action] 
     2156        if old_key: 
     2157            # some other key was previously bound to this action 
     2158            del self.rev_controls[old_key] 
    21542159        self.controls[action] = key 
    2155         self.rev_controls[key] = action 
     2160        if key is not None: 
     2161            self.rev_controls[key] = action 
    21562162 
    21572163    def zoom_in(self):