Changeset 178:98121552b435
- Timestamp:
- 05/13/12 08:55:07 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/gui.py
r172 r178 155 155 156 156 self._hotkeySetID = None 157 self._pilotHotkeyIndex = None 158 self._checklistHotkeyIndex = None 157 159 158 160 @property … … 1132 1134 """Setup the hotkeys based on the configuration.""" 1133 1135 if self._hotkeySetID is None and self._simulator is not None: 1134 self._hotkeySetID = \ 1135 self._simulator.listenHotkeys([self.config.pilotHotkey, 1136 self.config.checklistHotkey], 1137 self._handleHotkeys) 1136 self._pilotHotkeyIndex = None 1137 self._checklistHotkeyIndex = None 1138 1139 hotkeys = [] 1140 1141 config = self.config 1142 if config.enableSounds and config.pilotControlsSounds: 1143 self._pilotHotkeyIndex = len(hotkeys) 1144 hotkeys.append(config.pilotHotkey) 1145 1146 if config.enableChecklists: 1147 self._checklistHotkeyIndex = len(hotkeys) 1148 hotkeys.append(config.checklistHotkey) 1149 1150 if hotkeys: 1151 self._hotkeySetID = \ 1152 self._simulator.listenHotkeys(hotkeys, self._handleHotkeys) 1138 1153 1139 1154 def _clearHotkeys(self): … … 1147 1162 if id==self._hotkeySetID: 1148 1163 for index in hotkeys: 1149 if index==0: 1164 if index==self._pilotHotkeyIndex: 1165 print "gui.GUI._handleHotkeys: pilot hotkey pressed" 1150 1166 self._flight.pilotHotkeyPressed() 1167 elif index==self._checklistHotkeyIndex: 1168 print "gui.GUI._handleHotkeys: checklist hotkey pressed" 1169 self._flight.checklistHotkeyPressed() 1151 1170 else: 1152 self._flight.checklistHotkeyPressed()1171 print "gui.GUI._handleHotkeys: unhandled hotkey index:", index
Note:
See TracChangeset
for help on using the changeset viewer.