コード例 #1
0
def inject_handle_key_event(event):
    if config.enable:
        is_down, key, mods, is_repeat = game.convertKeyEvent(event)
        if config.debug and armor.flash:
            if key == Keys.KEY_NUMPAD6 and is_down and mods == config.setup[
                    'MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(10, 0)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change x +10'
            if key == Keys.KEY_NUMPAD4 and is_down and mods == config.setup[
                    'MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(-10, 0)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change x -10'
            if key == Keys.KEY_NUMPAD8 and is_down and mods == config.setup[
                    'MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(0, -10)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change y -10'
            if key == Keys.KEY_NUMPAD2 and is_down and mods == config.setup[
                    'MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(0, 10)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change y +10'
            if key == Keys.KEY_NUMPADMINUS and is_down and mods == config.setup[
                    'MODIFIER']['MODIFIER_ALT']:
                config.load_config_debug()
                armor.flash.data.update_pos()
                print 'config reloaded'
コード例 #2
0
    def handleKeyEvent(self, event):
        import game
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if isRepeat:
            return False
        elif self.__isStarted and self.__isDetached:
            if self.__curCtrl.alwaysReceiveKeyEvents() and not self.isObserverFPV or CommandMapping.g_instance.isFired(CommandMapping.CMD_CM_LOCK_TARGET, key):
                self.__curCtrl.handleKeyEvent(isDown, key, mods, event)
            return BigWorld.player().handleKey(isDown, key, mods)
        elif not self.__isStarted or self.__isDetached:
            return False
        for command in self.__commands:
            if command.handleKeyEvent(isDown, key, mods, event):
                return True

        if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
            if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
                gui_event_dispatcher.toggleCrosshairVisibility()
                return True
            if self.__showMarkersKey is not None and key == self.__showMarkersKey and not self.__isGUIVisible:
                gui_event_dispatcher.toggleMarkers2DVisibility()
                return True
            if key == Keys.KEY_F5 and constants.HAS_DEV_RESOURCES:
                self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
                return True
        if key == Keys.KEY_SPACE and isDown and BigWorld.player().isObserver():
            BigWorld.player().cell.switchObserverFPV(not BigWorld.player().isObserverFPV)
            return True
        else:
            return True if not self.isObserverFPV and self.__curCtrl.handleKeyEvent(isDown, key, mods, event) else BigWorld.player().handleKey(isDown, key, mods)
コード例 #3
0
def new_handler(event):
    if not BattleReplay.isPlaying():
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if isDown and mods == 4 and key == Keys.KEY_O:
            global_vars.increment_mode()
            SendGuiMessage(global_vars.active_mode.name)
        elif isDown and mods == 4 and key == Keys.KEY_B:
            if not global_vars.check_running:
                pressed_key()
        elif isDown and mods == 2 and key == Keys.KEY_O:
            global_vars.toggle_extended()
            if not global_vars.extended:
                SendGuiMessage("Disabled extention")
            elif global_vars.extended:
                SendGuiMessage("Enabled extention")
        elif isDown and mods == 4 and key == Keys.KEY_C:
            global_vars.toggle_enable_clear()
            if not global_vars.enable_clear:
                SendGuiMessage("Disabled clearing your blacklist!")
            elif global_vars.enable_clear:
                contactsForTime = ContactsManager()
                all_bl_users = contactsForTime.usersStorage.getList(
                    ItemsFindCriteria(XMPP_ITEM_TYPE.PERSISTENT_BLOCKING_LIST))
                SendGuiMessage(
                    "Enabled clearing your blacklist!\nMake sure you are in the garage!\nClearing everything will take {}!"
                    .format(
                        str(
                            datetime.timedelta(
                                seconds=round(len(all_bl_users) * 1.1)))))
        elif isDown and mods == 4 and key == Keys.KEY_X:
            if global_vars.enable_clear:
                clear_blacklist()
コード例 #4
0
def newhandleKeyEvent1(event):
    if spotted._enable:
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if spotted._debug and spotted.spotted_flash:
            if key == Keys.KEY_NUMPAD6 and isDown and mods == setup[
                    'MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(10, 0)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change x +10'
            if key == Keys.KEY_NUMPAD4 and isDown and mods == setup[
                    'MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(-10, 0)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change x -10'
            if key == Keys.KEY_NUMPAD8 and isDown and mods == setup[
                    'MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(0, -10)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change y -10'
            if key == Keys.KEY_NUMPAD2 and isDown and mods == setup[
                    'MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(0, 10)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change y +10'
            if key == Keys.KEY_NUMPADMINUS and isDown and mods == setup[
                    'MODIFIER']['MODIFIER_ALT']:
                __load_config_debug()
                spotted.spotted_flash.data._updatePos()
                print 'config reloaded'
コード例 #5
0
def inject_handle_key_event(event):
    if config.enable:
        is_down, key, mods, is_repeat = game.convertKeyEvent(event)
        if config.debug and armor.flash:
            if key == Keys.KEY_NUMPAD6 and is_down and mods == config.setup['MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(10, 0)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change x +10'
            if key == Keys.KEY_NUMPAD4 and is_down and mods == config.setup['MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(-10, 0)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change x -10'
            if key == Keys.KEY_NUMPAD8 and is_down and mods == config.setup['MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(0, -10)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change y -10'
            if key == Keys.KEY_NUMPAD2 and is_down and mods == config.setup['MODIFIER']['MODIFIER_ALT']:
                armor.flash.data.update_pos_debug(0, 10)
                armor.flash.data.update_pos()
                config.save_config_debug()
                print 'position change y +10'
            if key == Keys.KEY_NUMPADMINUS and is_down and mods == config.setup['MODIFIER']['MODIFIER_ALT']:
                config.load_config_debug()
                armor.flash.data.update_pos()
                print 'config reloaded'
コード例 #6
0
ファイル: __init__.py プロジェクト: webiumsk/WOT-0.9.15-CT
 def handleKeyEvent(self, event):
     import game
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if isRepeat:
         return False
     elif self.__isStarted and self.__isDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     elif not self.__isStarted or self.__isDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             self.__alwaysShowAim = not self.__alwaysShowAim
             getAim = getattr(self.__curCtrl, 'getAim')
             if getAim is not None:
                 aim = getAim()
                 if aim is not None:
                     aim.setVisible(self.__alwaysShowAim or BigWorld.player().isGuiVisible)
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not BigWorld.player().isGuiVisible:
             battle = g_appLoader.getDefBattleApp()
             if battle:
                 markersManager = battle.markersManager
                 markersManager.active(not markersManager.isActive)
             return True
         if key == Keys.KEY_F5 and constants.HAS_DEV_RESOURCES:
             self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     else:
         return BigWorld.player().handleKey(isDown, key, mods)
コード例 #7
0
 def handleKeyEvent(self, event):
     cursorDetached = self.__detachCount < 0
     import game
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if isRepeat:
         return False
     elif self.__isStarted and cursorDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     elif not self.__isStarted or cursorDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             self.__alwaysShowAim = not self.__alwaysShowAim
             getAim = getattr(self.__curCtrl, 'getAim')
             if getAim is not None:
                 aim = getAim()
                 aim.setVisible(self.__alwaysShowAim or BigWorld.player().isGuiVisible)
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not BigWorld.player().isGuiVisible:
             from gui.WindowsManager import g_windowsManager
             markersManager = g_windowsManager.battleWindow.vMarkersManager
             markersManager.active(not markersManager.isActive)
             return True
         if key == Keys.KEY_F5:
             self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     else:
         return BigWorld.player().handleKey(isDown, key, mods)
コード例 #8
0
def newhandleKeyEvent1(event):
    if spotted._enable:
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if spotted._debug and spotted.spotted_flash:
            if key == Keys.KEY_NUMPAD6 and isDown and mods == setup['MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(10, 0)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change x +10'
            if key == Keys.KEY_NUMPAD4 and isDown and mods == setup['MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(-10, 0)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change x -10'
            if key == Keys.KEY_NUMPAD8 and isDown and mods == setup['MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(0, -10)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change y -10'
            if key == Keys.KEY_NUMPAD2 and isDown and mods == setup['MODIFIER']['MODIFIER_ALT']:
                spotted.spotted_flash.data._updatePosDebug(0, 10)
                spotted.spotted_flash.data._updatePos()
                __save_config_debug()
                print 'position change y +10'
            if key == Keys.KEY_NUMPADMINUS and isDown and mods == setup['MODIFIER']['MODIFIER_ALT']:
                __load_config_debug()
                spotted.spotted_flash.data._updatePos()
                print 'config reloaded'
コード例 #9
0
 def handleKeyEvent(self, event):
     cursorDetached = self.__detachCount < 0
     import game
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if isRepeat:
         return False
     if self.__isStarted and cursorDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     if not self.__isStarted or cursorDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             self.__alwaysShowAim = not self.__alwaysShowAim
             getAim = getattr(self.__curCtrl, 'getAim')
             if getAim is not None:
                 aim = getAim()
                 if aim is not None:
                     aim.setVisible(self.__alwaysShowAim
                                    or BigWorld.player().isGuiVisible)
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not BigWorld.player(
         ).isGuiVisible:
             battle = g_appLoader.getDefBattleApp()
             if battle:
                 markersManager = battle.markersManager
                 markersManager.active(not markersManager.isActive)
             return True
         if key == Keys.KEY_F5 and constants.IS_DEVELOPMENT:
             self.__vertScreenshotCamera.enable(
                 not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     return BigWorld.player().handleKey(isDown, key, mods)
コード例 #10
0
ファイル: minimap.py プロジェクト: wotmods/WOTDecompiled
 def handleRepeatKeyEvent(self, event):
     if GUI_SETTINGS.minimapSize:
         from game import convertKeyEvent
         cmdMap = CommandMapping.g_instance
         isDown, key, mods, isRepeat = convertKeyEvent(event)
         if isRepeat and isDown and not BigWorld.isKeyDown(Keys.KEY_RSHIFT) and cmdMap.isFiredList((CommandMapping.CMD_MINIMAP_SIZE_DOWN, CommandMapping.CMD_MINIMAP_SIZE_UP), key):
             self.handleKey(key)
コード例 #11
0
ファイル: __init__.py プロジェクト: Infernux/Projects
 def handleKeyEvent(self, event):
     cursorDetached = self.__detachCount < 0
     import game
     (isDown, key, mods, isRepeat,) = game.convertKeyEvent(event)
     if isRepeat:
         return False
     if self.__isStarted and cursorDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     if not self.__isStarted or cursorDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             self.__alwaysShowAim = not self.__alwaysShowAim
             getAim = getattr(self.__curCtrl, 'getAim')
             if getAim is not None:
                 aim = getAim()
                 if aim is not None:
                     aim.setVisible(self.__alwaysShowAim or BigWorld.player().isGuiVisible)
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not BigWorld.player().isGuiVisible:
             from gui.WindowsManager import g_windowsManager
             markersManager = g_windowsManager.battleWindow.vMarkersManager
             markersManager.active(not markersManager.isActive)
             return True
         if key == Keys.KEY_F5 and constants.IS_DEVELOPMENT:
             self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     return BigWorld.player().handleKey(isDown, key, mods)
コード例 #12
0
ファイル: Builder.py プロジェクト: WorldOfTanksMods/wotmods
 def handleKeyEvent(event):
     if not hasattr(BigWorld.player(), "arena") or not Builder.isTraining() and not Builder.isReply():
         return oldHandleKeyEventFromBuilder(event)
     try:
         isDown, key, mods, isRepeat = game.convertKeyEvent(event)
         if not isRepeat and isDown:
             if HotKeysUtils.keyMatch(key, Builder.myConf["NextModel"]):
                 Builder.blockMove = False
                 Builder.inBattle = True
                 Builder.currentPath = Builder.pm.getNextPath()
                 position = BigWorld.player().inputHandler.getDesiredShotPoint()
                 if Builder.currentPreview is not None:
                     Builder.currentPreview.remove()
                 Builder.currentPreview = MyModel(-1, position, 0, Builder.currentPath)
                 if not Builder.moving:
                     BigWorld.callback(SERVER_TICK_LENGTH, Builder.previewMove)
                     Builder.moving = True
             if HotKeysUtils.keyMatch(key, Builder.myConf["PrevModel"]):
                 Builder.blockMove = False
                 Builder.inBattle = True
                 Builder.currentPath = Builder.pm.getPrevPath()
                 position = BigWorld.player().inputHandler.getDesiredShotPoint()
                 if Builder.currentPreview is not None:
                     Builder.currentPreview.remove()
                 Builder.currentPreview = MyModel(-1, position, 0, Builder.currentPath)
                 if not Builder.moving:
                     BigWorld.callback(SERVER_TICK_LENGTH, Builder.previewMove)
                     Builder.moving = True
             if HotKeysUtils.keyMatch(key, Builder.myConf["SaveModel"]):
                 position = BigWorld.player().inputHandler.getDesiredShotPoint()
                 yaw = 0
                 if Builder.currentPreview is not None:
                     yaw = Builder.currentPreview.getYaw()
                     position = Builder.currentPreview.getPosition()
                 Builder.mm.addModel(position, yaw, Builder.currentPath)
                 Builder.blockMove = False
             if HotKeysUtils.keyMatch(key, Builder.myConf["BlockMoving"]):
                 Builder.blockMove = not Builder.blockMove
             if HotKeysUtils.keyMatch(key, Builder.myConf["RotateLeft"]):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseRotation(Builder.myConf["RotationTick"])
             if HotKeysUtils.keyMatch(key, Builder.myConf["RotateRight"]):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseRotation(-Builder.myConf["RotationTick"])
             if HotKeysUtils.keyMatch(key, Builder.myConf["IncreaseAltitude"]):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseAltitude(Builder.myConf["AltitudeTick"])
             if HotKeysUtils.keyMatch(key, Builder.myConf["DecreaseAltitude"]):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseAltitude(-Builder.myConf["AltitudeTick"])
     except Exception as e:
         LOG_CURRENT_EXCEPTION()
     finally:
         return oldHandleKeyEventFromBuilder(event)
コード例 #13
0
 def handleRepeatKeyEvent(self, event):
     if GUI_SETTINGS.minimapSize:
         from game import convertKeyEvent
         cmdMap = CommandMapping.g_instance
         isDown, key, mods, isRepeat = convertKeyEvent(event)
         if isRepeat and isDown and cmdMap.isFiredList(
             (CommandMapping.CMD_MINIMAP_SIZE_DOWN,
              CommandMapping.CMD_MINIMAP_SIZE_UP), key):
             self.handleKey(key)
コード例 #14
0
def game_handleKeyEvent(event):
    global isChatDisabled
    hotkeyHide = config.get('hotkeys/hideBattleChat', {
        'enabled': True,
        'keyCode': Keys.KEY_H,
        'modifier': 'none'
    })
    gui = MessengerEntry.g_instance.gui
    if gui.isFocused():
        return
    if hotkeyHide.get('enabled', True):
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if key == hotkeyHide.get('keyCode',
                                 Keys.KEY_H) and isDown and not isRepeat:
            modifier = str(hotkeyHide.get('modifier', 'none')).lower()
            if mods != MODIFIERS.get(modifier, 'none'):
                return
            entry = gui._GUIDecorator__current()
            if isinstance(entry, BattleEntry):
                view = entry._BattleEntry__view()
                if view is not None:
                    view.flashObject.visible = not view.flashObject.visible

    hotkeyDisable = config.get('hotkeys/disableBattleChat', {
        'enabled': True,
        'keyCode': Keys.KEY_O,
        'modifier': 'none'
    })
    if hotkeyDisable.get('enabled', True):
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if key == hotkeyDisable.get('keyCode',
                                    Keys.KEY_O) and isDown and not isRepeat:
            modifier = str(hotkeyDisable.get('modifier', 'none')).lower()
            if mods != MODIFIERS.get(modifier, 'none'):
                return
            entry = gui._GUIDecorator__current()
            if isinstance(entry, BattleEntry):
                view = entry._BattleEntry__view()
                if view is not None:
                    isChatDisabled = not isChatDisabled
                    g_settings.userPrefs._replace(
                        disableBattleChat=isChatDisabled)
                    view.invalidateReceivers()
コード例 #15
0
ファイル: example.py プロジェクト: Mododejl/code-example
 def hotKey(self, event, parse, isDown=True, isRepeat=False):
     result = []
     event = convertKeyEvent(event)
     for key in [x.strip().upper() for x in parse.strip().upper().split(' AND ')]:
         try:
             result.append(getattr(Keys, key if key.startswith('KEY_') else 'KEY_' + key))
         except:
             pass
             
     if len(result) == 1:
         return event[1] == result[0] and self.event(event[3], event[0], isDown, isRepeat)
     return event[1] == result[1] and BigWorld.isKeyDown(result[0]) and self.event(event[3], event[0], isDown, isRepeat) if len(result) == 2 else False    
コード例 #16
0
def inject_handle_key_event(event):
    if config.enable:
        is_down, key, mods, is_repeat = game.convertKeyEvent(event)
        if key == config.setup['buttons']['crew_only']['KEY'] and is_down and mods == config.setup['buttons']['crew_only']['MODIFIER']:
            repair.heal()
        if key == config.setup['buttons']['device_only']['KEY'] and is_down and mods == config.setup['buttons']['device_only']['MODIFIER']:
            repair.repair()
        if key == config.setup['buttons']['chassis_only']['KEY'] and is_down and mods == config.setup['buttons']['chassis_only']['MODIFIER']:
            repair.repair_chassis()
        if key == config.setup['buttons']['universal']['KEY'] and is_down and mods == config.setup['buttons']['universal']['MODIFIER']:
            repair.fires()
            repair.heal()
            repair.repair()
コード例 #17
0
def new_handler(event):
    isDown, key, mods, _ = game.convertKeyEvent(event)
    KEY_C = 46
    if isPlatoonUIVisible():
        old_handler(event)
        return

    global lastTime
    if isDown and mods == 0 and key == KEY_C and time.time() - lastTime > 1:
        lastTime = time.time()
        if g_currentVehicle.isPresent():
            trainOPCrew(g_currentVehicle.item)
    old_handler(event)
    return
コード例 #18
0
ファイル: SpotMessanger.py プロジェクト: teroxin/wotmods
 def handleKeyEvent(event):
     try:
         isDown, key, mods, isRepeat = game.convertKeyEvent(event)
         if not isRepeat and isDown and HotKeysUtils.keysMatch([key],SpotMessanger.myconfig['ActivationHotkey']):
             if SpotMessanger.isActive:
                 BattleUtils.DebugMsg(SpotMessanger.myconfig['DisableSystemMsg'], True)
             else:
                 BattleUtils.DebugMsg(SpotMessanger.myconfig['EnableSystemMsg'], True)
             SpotMessanger.isActive = not SpotMessanger.isActive
             return
     except Exception as e:
         LOG_CURRENT_EXCEPTION()
     finally:
         return oldHandleKeyEventFromSpotMessanger(event)
コード例 #19
0
def inject_handle_key_event(event):
    is_down, key, mods, is_repeat = game.convertKeyEvent(event)
    is_in_battle = g_appLoader.getDefBattleApp()
    try:
        if is_in_battle:
            if _config.data['enabled']:
                if BigWorld.isKeyDown(_config.data['button_chassis_repair']) and is_down and mods == _config.data['button_chassis_repair_mod']:
                    _repair.repair_chassis()
                if BigWorld.isKeyDown(_config.data['button_fast_repair_all']) and is_down and mods == _config.data['button_fast_repair_all_mod']:
                    _repair.fires()
                    _repair.heal()
                    _repair.repair()
    except Exception as e:
        print('%s inject_handle_key_event' % _config.ids, e)
コード例 #20
0
    def new_handleKeyEvent(cls, event):
        global old_handleKeyEvent
        try:
            isDown, key, mods, isRepeat = game.convertKeyEvent(event)
            if not isRepeat and isDown:
                for k, v in cls.handlers.iteritems():
                    n = HotKeysUtils.parseHotkeys(k)
                    if HotKeysUtils.keysMatch([key], n):
                        v()
                        break

        except Exception as e:
            LOG_CURRENT_EXCEPTION()
        finally:
            return old_handleKeyEvent(event)
コード例 #21
0
ファイル: Plugin.py プロジェクト: IJOL/wotmods
    def new_handleKeyEvent(cls, event):
        global old_handleKeyEvent
        try:
            isDown, key, mods, isRepeat = game.convertKeyEvent(event)
            if not isRepeat and isDown:
                for k, v in cls.handlers.iteritems():
                    n = HotKeysUtils.parseHotkeys(k)
                    if HotKeysUtils.keysMatch([key], n):
                        v()
                        break

        except Exception as e:
            LOG_CURRENT_EXCEPTION()
        finally:
            return old_handleKeyEvent(event)
コード例 #22
0
def game_handleKeyEvent(event):
    global isDownHotkey
    if config.get('sight/enabled', True):  # and isNotEvent:
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        hotkey = config.get('sight/sphereDispersion/hotkey', None)
        if hotkey is not None and hotkey['enabled'] and (key
                                                         == hotkey['keyCode']):
            if hotkey['onHold']:
                if isDown:
                    if not isDownHotkey:
                        isDownHotkey = True
                else:
                    if isDownHotkey:
                        isDownHotkey = False
            else:
                if isDown:
                    isDownHotkey = not isDownHotkey
コード例 #23
0
ファイル: SpotMessanger.py プロジェクト: KingRider/wotmods
 def handleKeyEvent(event):
     try:
         isDown, key, mods, isRepeat = game.convertKeyEvent(event)
         if not isRepeat and isDown and HotKeysUtils.keysMatch(
             [key], SpotMessanger.myconfig['ActivationHotkey']):
             if SpotMessanger.isActive:
                 BattleUtils.DebugMsg(
                     SpotMessanger.myconfig['DisableSystemMsg'], True)
             else:
                 BattleUtils.DebugMsg(
                     SpotMessanger.myconfig['EnableSystemMsg'], True)
             SpotMessanger.isActive = not SpotMessanger.isActive
             return
     except Exception as e:
         LOG_CURRENT_EXCEPTION()
     finally:
         return oldHandleKeyEventFromSpotMessanger(event)
コード例 #24
0
def game_handleKeyEvent(event):
    sessionProvider = dependency.instance(IBattleSessionProvider)
    hotkey = config.get('hotkeys/quicklyLeave', {
        'enabled': True,
        'keyCode': 62
    })
    if hotkey.get('enabled',
                  True) and sessionProvider.getArenaDP() is not None:
        if MessengerEntry.g_instance.gui.isFocused():
            return
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        if key == hotkey.get('keyCode', 62) and isDown and not isRepeat:
            exitResult = sessionProvider.getExitResult()
            arenaType = sessionProvider.arenaVisitor.getArenaGuiType()
            if exitResult.isDeserter and arenaType not in _ARENAS_WITHOUT_DEZERTER_PUNISHMENTS:
                return
            sessionProvider.exit()
コード例 #25
0
def game_handleKeyEvent(event):
    if _config.get(HIT_LOG_ENABLED, True) and battle.isBattleTypeSupported:
        isDown, key, mods, isRepeat = game.convertKeyEvent(event)
        hotkey = _config.get('hotkeys/hitLogAltMode')
        if hotkey['enabled'] and (key == hotkey['keyCode']):
            if hotkey['onHold']:
                if isDown:
                    if not g_hitLogs.isDownAlt:
                        g_hitLogs.isDownAlt = True
                        as_event(ON_HIT_LOG)
                else:
                    if g_hitLogs.isDownAlt:
                        g_hitLogs.isDownAlt = False
                        as_event(ON_HIT_LOG)
            else:
                if isDown:
                    g_hitLogs.isDownAlt = not g_hitLogs.isDownAlt
                    as_event(ON_HIT_LOG)
コード例 #26
0
def game_handleKeyEvent(event):
    isDown, key, mods, isRepeat = game.convertKeyEvent(event)
    if mods == 0 and isDown and settingsPM['proxy'] is not None:
        app = dependency.instance(IAppLoader)
        player = BigWorld.player()
        if key == settingsPM['key'] and app.getDefBattleApp(
        ) and player.inputHandler.isGuiVisible:
            if settingsPM['marker']:
                player.guiSessionProvider.shared.feedback.onVehicleMarkerRemoved(
                    settingsPM['proxy'].id)
                settingsPM['marker'] = False
            else:
                vInfo = settingsPM['arenaDP'].getVehicleInfo(
                    settingsPM['proxy'].id)
                player.guiSessionProvider.shared.feedback.onVehicleMarkerAdded(
                    settingsPM['proxy'], vInfo,
                    settingsPM['arenaDP'].getPlayerGuiProps(
                        settingsPM['proxy'].id, vInfo.team))
                settingsPM['marker'] = True
コード例 #27
0
 def handleKeyEvent(self, event):
     import game
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if isRepeat:
         return False
     elif self.__isStarted and self.__isDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     elif not self.__isStarted or self.__isDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             gui_event_dispatcher.toggleCrosshairVisibility()
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not self.__isGUIVisible:
             gui_event_dispatcher.toggleMarkers2DVisibility()
             return True
         if key == Keys.KEY_F5 and constants.HAS_DEV_RESOURCES:
             self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     else:
         return BigWorld.player().handleKey(isDown, key, mods)
コード例 #28
0
ファイル: __init__.py プロジェクト: webiumsk/WOT-0.9.15.1
 def handleKeyEvent(self, event):
     import game
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if isRepeat:
         return False
     elif self.__isStarted and self.__isDetached:
         return BigWorld.player().handleKey(isDown, key, mods)
     elif not self.__isStarted or self.__isDetached:
         return False
     if isDown and BigWorld.isKeyDown(Keys.KEY_CAPSLOCK):
         if self.__alwaysShowAimKey is not None and key == self.__alwaysShowAimKey:
             gui_event_dispatcher.toggleCrosshairVisibility()
             return True
         if self.__showMarkersKey is not None and key == self.__showMarkersKey and not self.__isGUIVisible:
             gui_event_dispatcher.toggleMarkers2DVisibility()
             return True
         if key == Keys.KEY_F5 and constants.HAS_DEV_RESOURCES:
             self.__vertScreenshotCamera.enable(not self.__vertScreenshotCamera.isEnabled)
             return True
     if self.__curCtrl.handleKeyEvent(isDown, key, mods, event):
         return True
     else:
         return BigWorld.player().handleKey(isDown, key, mods)
コード例 #29
0
def handleKeyEvent(event):
    is_down, key, mods, is_repeat = game.convertKeyEvent(event)
    if key is getattr(Keys, config('reloadKey'), 0) and is_down:
        config.reload()
コード例 #30
0
def inject_handle_key_event(event):
    is_down, key, mods, is_repeat = game.convertKeyEvent(event)
    if mods == Keys.MODIFIER_CTRL and key == Keys.KEY_B and is_down:
        loadWindow(_aManagerAlias)
コード例 #31
0
def handleKeyEvent(event):
    is_down, key, mods, is_repeat = game.convertKeyEvent(event)
    if key is getattr(Keys, config('reloadKey'), 0) and is_down:
        config.reload()
コード例 #32
0
 def visible_tab(self, event):
     isdown, key, mods, is_repeat = game.convertKeyEvent(event)
     if not is_repeat and key == 15:
         boole = not isdown if self.isVisible else False
         self.component.visible = boole
コード例 #33
0
ファイル: Builder.py プロジェクト: whenisee/wotmods
 def handleKeyEvent(event):
     if not hasattr(
             BigWorld.player(),
             'arena') or not Builder.isTraining() and not Builder.isReply():
         return oldHandleKeyEventFromBuilder(event)
     try:
         isDown, key, mods, isRepeat = game.convertKeyEvent(event)
         if not isRepeat and isDown:
             if HotKeysUtils.keyMatch(key, Builder.myConf['NextModel']):
                 Builder.blockMove = False
                 Builder.inBattle = True
                 Builder.currentPath = Builder.pm.getNextPath()
                 position = BigWorld.player(
                 ).inputHandler.getDesiredShotPoint()
                 if Builder.currentPreview is not None:
                     Builder.currentPreview.remove()
                 Builder.currentPreview = MyModel(-1, position, 0,
                                                  Builder.currentPath)
                 if not Builder.moving:
                     BigWorld.callback(SERVER_TICK_LENGTH,
                                       Builder.previewMove)
                     Builder.moving = True
             if HotKeysUtils.keyMatch(key, Builder.myConf['PrevModel']):
                 Builder.blockMove = False
                 Builder.inBattle = True
                 Builder.currentPath = Builder.pm.getPrevPath()
                 position = BigWorld.player(
                 ).inputHandler.getDesiredShotPoint()
                 if Builder.currentPreview is not None:
                     Builder.currentPreview.remove()
                 Builder.currentPreview = MyModel(-1, position, 0,
                                                  Builder.currentPath)
                 if not Builder.moving:
                     BigWorld.callback(SERVER_TICK_LENGTH,
                                       Builder.previewMove)
                     Builder.moving = True
             if HotKeysUtils.keyMatch(key, Builder.myConf['SaveModel']):
                 position = BigWorld.player(
                 ).inputHandler.getDesiredShotPoint()
                 yaw = 0
                 if Builder.currentPreview is not None:
                     yaw = Builder.currentPreview.getYaw()
                     position = Builder.currentPreview.getPosition()
                 Builder.mm.addModel(position, yaw, Builder.currentPath)
                 Builder.blockMove = False
             if HotKeysUtils.keyMatch(key, Builder.myConf['BlockMoving']):
                 Builder.blockMove = not Builder.blockMove
             if HotKeysUtils.keyMatch(key, Builder.myConf['RotateLeft']):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseRotation(
                     Builder.myConf['RotationTick'])
             if HotKeysUtils.keyMatch(key, Builder.myConf['RotateRight']):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseRotation(
                     -Builder.myConf['RotationTick'])
             if HotKeysUtils.keyMatch(key,
                                      Builder.myConf['IncreaseAltitude']):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseAltitude(
                     Builder.myConf['AltitudeTick'])
             if HotKeysUtils.keyMatch(key,
                                      Builder.myConf['DecreaseAltitude']):
                 if Builder.currentPreview is None:
                     return
                 Builder.currentPreview.increaseAltitude(
                     -Builder.myConf['AltitudeTick'])
     except Exception as e:
         LOG_CURRENT_EXCEPTION()
     finally:
         return oldHandleKeyEventFromBuilder(event)
コード例 #34
0
 def _visibleTAB(self, event):
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if not isRepeat and key == 15:
         bool = not isDown if self.isVisible else False
         self.component.visible = bool
コード例 #35
0
 def visible_tab(self, event):
     isdown, key, mods, is_repeat = game.convertKeyEvent(event)
     if not is_repeat and key == 15:
         boole = not isdown if self.isVisible else False
         self.component.visible = boole
コード例 #36
0
 def __handleKeyEvent(self, event):
     cmdMap = CommandMapping.g_instance
     isDown, key, _, isRepeat = convertKeyEvent(event)
     if cmdMap.isFired(CommandMapping.CMD_LOGITECH_SWITCH_VIEW,
                       key) and isDown and not isRepeat:
         self.changeView()
コード例 #37
0
 def _visibleTAB(self, event):
     isDown, key, mods, isRepeat = game.convertKeyEvent(event)
     if not isRepeat and key == 15:
         bool = not isDown if self.isVisible else False
         self.component.visible = bool
コード例 #38
0
 def __handleKeyEvent(self, event):
     cmdMap = CommandMapping.g_instance
     isDown, key, _, isRepeat = convertKeyEvent(event)
     if cmdMap.isFired(CommandMapping.CMD_LOGITECH_SWITCH_VIEW, key) and isDown and not isRepeat:
         self.changeView()
コード例 #39
0
ファイル: squad_minimap.py プロジェクト: Wanket/Squad-Minimap
def handleKeyEvent(event):
    isDown, key, mods, isRepeat = game.convertKeyEvent(event)
    if key == Keys.KEY_LALT:
        modSM.isKeyPress = isDown