L_ShortCutConst = {}
L_ShortCutConst.inputMap = {
  pageRogueEvent = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageAttendance = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageTimeline = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  dialogWindow = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageVideo = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageReward = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageGetPetEgg = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pagePetFinishDuel = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageProduct = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageBuildingUpgrade = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageStation = {
    C_InputManager_MapType.BlanketInputMap,
    true
  },
  pageMainCity = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageMultiDungeon = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageOtaku = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageOtakuEdit = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageOtakuPut = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageRogue = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageFishing = {
    C_InputManager_MapType.FishingInputMap,
    true
  },
  pageMask = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageBigMap = {
    C_InputManager_MapType.PageBigMapMap,
    true
  },
  pageChat = {
    C_InputManager_MapType.PageChatInputMap,
    true
  },
  pageMainWorld = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageLevelSimulator = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageWorldBattleLocal = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageWorldBattleLocalPC = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  gmHeroView = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageWorldBattle = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageWorldBattlePC = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageFaceIn = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageHomePlayerEdit = {
    C_InputManager_MapType.PagePlayerEditInputMap,
    true
  },
  pageHomePlayerEditCS = {
    C_InputManager_MapType.PagePlayerEditInputMap,
    true
  },
  pageMOD = {
    C_InputManager_MapType.PageMODMap,
    true
  },
  pagePhotographScene = {
    C_InputManager_MapType.PagePhotoMap,
    true
  },
  pagePhotographPoint = {
    C_InputManager_MapType.PagePhotographPoint,
    true
  },
  pagePhoto = {
    C_InputManager_MapType.PagePhotoMap,
    true
  },
  pageWorldLevelChange = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pageBattlePetCatch = {
    C_InputManager_MapType.PetCatch,
    true
  },
  pageBag = {
    C_InputManager_MapType.PageBag,
    true
  },
  pageHomeBag = {
    C_InputManager_MapType.PageHomeBag,
    true
  },
  pagePetDuel = {-1, true},
  pagePetBox = {
    C_InputManager_MapType.PagePetBox,
    true
  },
  dialogBranchWindow_NewStory = {
    C_InputManager_MapType.PageDialogueBranch,
    true
  },
  dialogWindow_NewStory = {
    C_InputManager_MapType.PageDialogue,
    true
  },
  pagePlayerExpUp = {
    C_InputManager_MapType.MainInputMap,
    true
  },
  pagePlayerLevelUp = {
    C_InputManager_MapType.MainInputMap,
    true
  }
}
L_ShortCutConst.shortCutMap = {
  [C_InputManager_KeyType.EMainOpenBag] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.bag)
  end,
  [C_InputManager_KeyType.EMainOpenTeam] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.formation)
  end,
  [C_InputManager_KeyType.EMainOpenMap] = function()
    L_UI:open("pageBigMap")
  end,
  [C_InputManager_KeyType.EMainOpenHero] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.hero)
  end,
  [C_InputManager_KeyType.EMainScanning] = function()
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.StartScanning)
  end,
  [C_InputManager_KeyType.EMainOpenHome] = function()
    L_HomeUtil.switchInOutHome()
  end,
  [C_InputManager_KeyType.EMainTutorial] = function()
    L_GuideManager:internalSendEvent(G_GuideClasses.GuideEvent.TutotialGuideEnd)
  end,
  [C_InputManager_KeyType.EMainOpenHomeBag] = function()
    L_UI:open("pageHomeBag")
  end,
  [C_InputManager_KeyType.EMainOpenHomeScience] = function()
    if AzurWorld.HomeMgr.IsInHome == true then
      L_SystemBreakManager:jumpTo(L_SystemConst.enum.homeScience)
    end
  end,
  [C_InputManager_KeyType.EMainOpenTasks] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.task)
  end,
  [C_InputManager_KeyType.EMainOpenPet] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.pet)
  end,
  [C_InputManager_KeyType.EMainTalking] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.chat)
  end,
  [C_InputManager_KeyType.EMainOpenActivity] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.activation)
  end,
  [C_InputManager_KeyType.EMainOpenMail] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.mail)
  end,
  [C_InputManager_KeyType.EMainOpenSpecialShop] = function()
  end,
  [C_InputManager_KeyType.EMainOpenGameAct] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.gameAct)
  end,
  [C_InputManager_KeyType.EMainOpenTutorial] = function()
    L_UI:open("pageTutorial")
  end,
  [C_InputManager_KeyType.EMainOpenNoviceTask] = function()
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.noviceTask)
  end,
  [C_InputManager_KeyType.EMainNowTask] = function()
  end,
  [C_InputManager_KeyType.EMainSwitchHero1] = function()
    L_FormationManager:switchMyPlayerMainControl(0)
  end,
  [C_InputManager_KeyType.EMainSwitchHero2] = function()
    L_FormationManager:switchMyPlayerMainControl(1)
  end,
  [C_InputManager_KeyType.EMainSwitchHero3] = function()
    L_FormationManager:switchMyPlayerMainControl(2)
  end,
  [C_InputManager_KeyType.EMainSwitchHero4] = function()
    L_FormationManager:switchMyPlayerMainControl(3)
  end,
  [C_InputManager_KeyType.EMainOneKeySwitch] = function()
  end,
  [C_InputManager_KeyType.EMainCallMount] = function()
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.Mount)
  end,
  [C_InputManager_KeyType.EMainMountFly] = function()
  end,
  [C_InputManager_KeyType.EMainPetSkill] = function()
  end,
  [C_InputManager_KeyType.EMainPetSkillRoulette] = function(isPress)
    local result = L_SystemUnlockManager:checkAndTip(L_SystemConst.enum.petPuzzleRoulette)
    if not result then
      return
    end
    if L_HomeUtil.isInHome() then
      L_FlyMsgManager:showNormalMsg(L_WordsTpl:getValue("ui_homeFunction"))
      return
    end
    if L_BattleDataManager:checkPlayerBattle() then
      L_FlyMsgManager:showNormalMsg(L_WordsTpl:getValue("notice_petriddle_fight"))
      return
    end
    if L_PlayerManager:inKiBoTransformMainControl() then
      return
    end
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.LongPressPetSkill, isPress)
  end,
  [C_InputManager_KeyType.EMainMountRoulette] = function(isPress)
    if L_PlayerManager:inKiBoTransformMainControl() then
      return
    end
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.LongPressMount, isPress)
  end,
  [C_InputManager_KeyType.ETaskToMap] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.TaskToMap, isPress)
  end,
  [C_InputManager_KeyType.EMainPetGet] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.PetGet, isPress)
  end,
  [C_InputManager_KeyType.EMainPetCatalog] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.PetCatalog, isPress)
  end,
  [C_InputManager_KeyType.ESelectKiBo1] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonStart(1)
  end,
  [C_InputManager_KeyType.ESelectKiBo2] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonStart(2)
  end,
  [C_InputManager_KeyType.ESelectKiBo3] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonStart(3)
  end,
  [C_InputManager_KeyType.ESelectKiBo4] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonStart(4)
  end,
  [C_InputManager_KeyType.EConfirmKiBo] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonConfirm()
  end,
  [C_InputManager_KeyType.ECancelKiBo] = function(isPress)
    L_KiBoDuelManager:handleKiBoSummonCancel()
  end,
  [C_InputManager_KeyType.EConfirmKiBoSkill] = function(isPress)
    L_KiBoDuelManager:handleConfirmSkillRelease(nil, L_KiBoDuelManager.skillStausEnum.normal)
  end,
  [C_InputManager_KeyType.ECancelKiBoSkill] = function(isPress)
    L_KiBoDuelManager:handleCancelSkillRelease(nil, L_KiBoDuelManager.skillStausEnum.normal)
  end,
  [C_InputManager_KeyType.EPetDuelStatistics] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.PetDuelStatistics, isPress)
  end,
  [C_InputManager_KeyType.EKiBoVersusCommonSkill1] = function(isPress)
    L_KiBoDuelManager:changeSkillStatus(L_Const.skillType.KiBoVersusCommonSkill1, L_KiBoDuelManager.skillStausEnum.waitConfirm)
  end,
  [C_InputManager_KeyType.EKiBoVersusCommonSkill2] = function(isPress)
    L_KiBoDuelManager:changeSkillStatus(L_Const.skillType.KiBoVersusCommonSkill2, L_KiBoDuelManager.skillStausEnum.waitConfirm)
  end,
  [C_InputManager_KeyType.EKiBoSkillInfoSwitch1] = function(isPress)
    L_KiBoDuelManager:handSwitchSkillInfo(L_Const.kiBoDuelInfoType.talentPrevious)
  end,
  [C_InputManager_KeyType.EKiBoSkillInfoSwitch2] = function(isPress)
    L_KiBoDuelManager:handSwitchSkillInfo(L_Const.kiBoDuelInfoType.talentNext)
  end,
  [C_InputManager_KeyType.EKiBoSkillInfoSwitch3] = function(isPress)
    L_KiBoDuelManager:handSwitchSkillInfo(L_Const.kiBoDuelInfoType.skillPrevious)
  end,
  [C_InputManager_KeyType.EKiBoSkillInfoSwitch4] = function(isPress)
    L_KiBoDuelManager:handSwitchSkillInfo(L_Const.kiBoDuelInfoType.skillNext)
  end,
  [C_InputManager_KeyType.EMainSkill] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.KeyCodeE, isPress)
  end,
  [C_InputManager_KeyType.EMainUltimateSkill] = function(isPress)
    L_ShortCutManager:sendEvent(L_ShortCutConst.event.KeyCodeR, isPress)
  end,
  [C_InputManager_KeyType.EMainHomeTechnology] = function(isPress)
    L_SystemBreakManager:jumpTo(L_SystemConst.enum.homeScience)
  end
}
L_ShortCutConst.shortCutMapNeedFlag = {
  [C_InputManager_KeyType.EMainMountRoulette] = true,
  [C_InputManager_KeyType.EMainTab] = true,
  [C_InputManager_KeyType.EMainPetSkillRoulette] = true
}
L_ShortCutConst.mainCityKeyMap = {
  [C_EWorldType.World] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.WhiteBox] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.Prologue] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.Dungeon] = {
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.MultiDungeon] = {
    shortCutList = {
      C_InputManager_KeyType.EMainSwitchHero1,
      C_InputManager_KeyType.EMainSwitchHero2,
      C_InputManager_KeyType.EMainSwitchHero3,
      C_InputManager_KeyType.EMainOpenMap,
      C_InputManager_KeyType.EMainTalking,
      C_InputManager_KeyType.EMainCallMount,
      C_InputManager_KeyType.EMainMountFly,
      C_InputManager_KeyType.EMainPetSkill,
      C_InputManager_KeyType.EMainMountRoulette
    }
  },
  [C_EWorldType.Home] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.HomeBase] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.BigBattleWorld] = {
    shortCutList = {}
  },
  [C_EWorldType.Interim] = {
    menuPage = "pageMainMenu",
    shortCutList = {},
    useMainCityShortCut = true
  },
  [C_EWorldType.KiboDuel] = {
    shortCutList = {
      C_InputManager_KeyType.ESelectKiBo1,
      C_InputManager_KeyType.ESelectKiBo2,
      C_InputManager_KeyType.ESelectKiBo3,
      C_InputManager_KeyType.ESelectKiBo4,
      C_InputManager_KeyType.EConfirmKiBo,
      C_InputManager_KeyType.ECancelKiBo,
      C_InputManager_KeyType.EMainMountRoulette,
      C_InputManager_KeyType.EMainCallMount,
      C_InputManager_KeyType.EMainMountFly,
      C_InputManager_KeyType.EKiBoVersusCommonSkill1,
      C_InputManager_KeyType.EKiBoVersusCommonSkill2,
      C_InputManager_KeyType.EKiBoSkillInfoSwitch1,
      C_InputManager_KeyType.EKiBoSkillInfoSwitch2,
      C_InputManager_KeyType.EKiBoSkillInfoSwitch3,
      C_InputManager_KeyType.EKiBoSkillInfoSwitch4,
      C_InputManager_KeyType.EConfirmKiBoSkill,
      C_InputManager_KeyType.ECancelKiBoSkill,
      C_InputManager_KeyType.EPetDuelStatistics
    }
  }
}
local getMainCityShortCutList = function()
  local res = {}
  for i, v in pairs(L_ShortCutConst.shortCutMap) do
    table.insert(res, i)
  end
  for _, v in pairs(L_ShortCutConst.mainCityKeyMap) do
    if v.useMainCityShortCut then
      v.shortCutList = res
    end
  end
end
getMainCityShortCutList()
L_ShortCutConst.event = {
  Mount = "ShortCutManager_Mount",
  MountFly = "ShortCutManager_MountFly",
  LongPressMount = "ShortCutManager_LongPressMount",
  LongPressPetSkill = "ShortCutManager_LongPressPetSkill",
  UseRoulette = "ShortCutManager_UseRoulette",
  TaskToMap = "ShortCutManager_TaskToMap",
  KiBoSkill = "KiBoSkill",
  PetDuelStatistics = "PetDuelStatistics",
  StartScanning = "StartScanning",
  PetGet = "ShortCutManager_PetGet",
  PetCatalog = "ShortCutManager_PetCatalog",
  KeyCodeE = "ShortCutManager_KeyCodeE",
  KeyCodeR = "ShortCutManager_KeyCodeR"
}
