annotate SkeletonKey/KeySlot.lua @ 15:32d64e42ec9b

- resolve pet bar actions for binding slots - detect type of petaction (can be spell, stance, or 'PETACTION') - keep track of displayed pet ability slots and update them alongside pet cache refreshes
author Nenue
date Fri, 29 Jul 2016 03:27:15 -0400
parents 82170735e67c
children cdd387d39137
rev   line source
Nenue@14 1 -- SkeletonKey
Nenue@14 2 -- KeySlot.lua
Nenue@14 3 -- Created: 7/28/2016 11:26 PM
Nenue@14 4 -- %file-revision%
Nenue@14 5 -- All the internal slot logic is kept here
Nenue@14 6
Nenue@14 7 local kb, print = LibStub('LibKraken').register(KeyBinder, 'Slot')
Nenue@14 8 local CURSOR_SPELLSLOT, CURSOR_BOOKTYPE, CURSOR_PETACTION
Nenue@14 9 local SUMMON_RANDOM_FAVORITE_MOUNT_SPELL = 150544
Nenue@15 10 local BORDER_UNASSIGNED = {0.2,0.2,0.2,1}
Nenue@15 11 local BORDER_ASSIGNED = {1,1,1,1}
Nenue@14 12 local BORDER_DYNAMIC = {1,1,0,1}
Nenue@14 13 local BORDER_PENDING = {1,0.5,0,1 }
Nenue@14 14
Nenue@14 15 local BUTTON_HEADERS = {
Nenue@14 16 ['spell'] = SPELLS,
Nenue@14 17 ['macro'] = MACRO,
Nenue@14 18 ['petaction'] = PET,
Nenue@14 19 ['mount'] = MOUNT,
Nenue@14 20 ['battlepet'] = BATTLEPET,
Nenue@14 21
Nenue@14 22
Nenue@14 23 [5] = PROFESSIONS_FIRST_AID,
Nenue@14 24 [7] = PROFESSIONS_COOKING,
Nenue@14 25 [9] = PROFESSIONS_FISHING,
Nenue@14 26 [10] = PROFESSIONS_ARCHAEOLOGY,
Nenue@14 27
Nenue@14 28 }
Nenue@14 29
Nenue@14 30 -- This is needed to identify a spells that aren't reflected by GetCursorInfo()
Nenue@14 31 hooksecurefunc("PickupSpellBookItem", function(slot, bookType)
Nenue@14 32 print('|cFFFF4400PickupSpellBookItem(..', tostring(slot),', '..tostring(bookType)..')')
Nenue@14 33 CURSOR_SPELLSLOT = slot
Nenue@14 34 CURSOR_BOOKTYPE = bookType
Nenue@14 35 end)
Nenue@14 36
Nenue@14 37 do
Nenue@14 38 -- Pet actions
Nenue@14 39 local isPickup
Nenue@14 40 hooksecurefunc("PickupPetAction", function(slot, ...)
Nenue@14 41 isPickup = GetCursorInfo()
Nenue@15 42 print(slot, ...)
Nenue@14 43
Nenue@15 44
Nenue@15 45 if kb.PetCache.action[slot] then
Nenue@15 46 if isPickup then
Nenue@15 47 local key = kb.PetCache.action[slot][1]
Nenue@15 48 local spellName = _G[key] or key
Nenue@15 49 if spellName and kb.PetCache.spellslot[spellName] then
Nenue@15 50 print('picked up', spellName, kb.PetCache.spellslot[spellName][1])
Nenue@15 51 CURSOR_SPELLSLOT = kb.PetCache.spellslot[spellName][1]
Nenue@15 52 CURSOR_BOOKTYPE = BOOKTYPE_PET
Nenue@15 53 end
Nenue@15 54
Nenue@15 55 else
Nenue@15 56 print('Dropped pet action =', GetPetActionInfo(slot))
Nenue@15 57 end
Nenue@14 58 print('|cFFFF4400PickupPetAction|r', isPickup, CURSOR_PETACTION)
Nenue@15 59 end
Nenue@15 60
Nenue@15 61 local name, subtext, texture, isToken = GetPetActionInfo(slot)
Nenue@15 62 if name then
Nenue@15 63 kb.PetCache.action[slot] = {name, subtext, texture, isToken}
Nenue@15 64 end
Nenue@15 65
Nenue@14 66 end)
Nenue@14 67 end
Nenue@14 68
Nenue@14 69
Nenue@14 70 kb.DropToSlot = function(self)
Nenue@14 71 print(self:GetName(),'|cFF0088FFreceived|r')
Nenue@14 72 local actionType, actionID, subType, subData = GetCursorInfo()
Nenue@14 73 print('GetCursorInfo', GetCursorInfo())
Nenue@14 74 if actionType then
Nenue@14 75
Nenue@14 76 if actionType == 'flyout' then
Nenue@14 77 ClearCursor()
Nenue@14 78 ResetCursor()
Nenue@14 79 return
Nenue@14 80 end
Nenue@14 81
Nenue@14 82
Nenue@15 83 local name, icon, _
Nenue@14 84 local pickupID, pickupBook
Nenue@14 85
Nenue@14 86 if actionType == 'spell' then
Nenue@14 87 actionID = subData
Nenue@14 88 name, _, icon = GetSpellInfo(actionID)
Nenue@14 89
Nenue@14 90 elseif actionType == 'macro' then
Nenue@14 91 name, icon = GetMacroInfo(actionID)
Nenue@14 92 elseif actionType == 'petaction' then
Nenue@15 93 if CURSOR_SPELLSLOT and CURSOR_BOOKTYPE then
Nenue@14 94
Nenue@15 95 local spellType, spellID = GetSpellBookItemInfo(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE)
Nenue@15 96 local spellName, spellText = GetSpellBookItemName(CURSOR_SPELLSLOT, CURSOR_BOOKTYPE)
Nenue@15 97 if spellType == 'PETACTION' then
Nenue@15 98 actionID = spellText
Nenue@15 99 else
Nenue@15 100 name, _, icon = GetSpellInfo(spellID)
Nenue@15 101 actionID = spellID
Nenue@15 102 end
Nenue@15 103
Nenue@15 104 pickupID = CURSOR_SPELLSLOT
Nenue@15 105 pickupBook = CURSOR_BOOKTYPE
Nenue@15 106 else
Nenue@15 107
Nenue@14 108 end
Nenue@14 109
Nenue@14 110 elseif actionType == 'mount' then
Nenue@14 111 if subType == 0 then
Nenue@14 112 name, _, icon = GetSpellInfo(SUMMON_RANDOM_FAVORITE_MOUNT_SPELL)
Nenue@14 113 actionID = 0
Nenue@14 114 else
Nenue@14 115 name, _, icon = C_MountJournal.GetMountInfoByID(actionID)
Nenue@14 116 end
Nenue@14 117 elseif actionType == 'item' then
Nenue@14 118 name = GetItemInfo(actionID)
Nenue@14 119 icon = GetItemIcon(actionID)
Nenue@14 120 actionID = name
Nenue@14 121 elseif actionType == 'battlepet' then
Nenue@14 122
Nenue@14 123 local speciesID, customName, level, xp, maxXp, displayID, isFavorite, petName, petIcon, petType, creatureID = C_PetJournal.GetPetInfoByPetID(detail);
Nenue@14 124 name = customName or petName
Nenue@14 125 icon = petIcon
Nenue@14 126
Nenue@14 127 end
Nenue@15 128 local macroName, macroText, command = kb.RegisterAction(actionType, actionID, name)
Nenue@14 129
Nenue@14 130
Nenue@14 131 local isAssigned, isBound, assignedBy, boundBy = kb.IsCommandBound(self, command)
Nenue@14 132 if isAssigned then
Nenue@14 133 local popup = StaticPopupDialogs["SKELETONKEY_CONFIRM_ASSIGN_SLOT"]
Nenue@14 134 popup.slot = self
Nenue@14 135 popup.text = "Currently assigned in |cFFFFFF00"..tostring(kb.configHeaders[assignedBy]).."|r. Are you sure?"
Nenue@14 136 popup.oldProfile = assignedBy
Nenue@14 137 popup.args = {command, name, icon, actionType, actionID, macroName, macroText, pickupID, pickupBook }
Nenue@14 138 kb:SetScript('OnMouseWheel', nil) -- disable scrolling
Nenue@14 139 StaticPopup_Show('SKELETONKEY_CONFIRM_ASSIGN_SLOT')
Nenue@14 140 else
Nenue@14 141 kb.SetSlot(self, command, name, icon, actionType, actionID, macroName, macroText, pickupID, pickupBook)
Nenue@14 142 kb.UpdateSlot(self)
Nenue@14 143 self.active = nil
Nenue@14 144 ClearCursor()
Nenue@14 145 ResetCursor()
Nenue@14 146 end
Nenue@14 147 end
Nenue@14 148 end
Nenue@14 149
Nenue@14 150
Nenue@14 151 do
Nenue@14 152 local PickupAction = {
Nenue@14 153 spell = _G.PickupSpell,
Nenue@14 154 petaction = _G.PickupSpellBookItem,
Nenue@14 155 macro = _G.PickupMacro,
Nenue@14 156 item = _G.PickupItem,
Nenue@14 157 mount = _G.C_MountJournal.Pickup
Nenue@14 158 }
Nenue@14 159 local GetPickupValue = {
Nenue@14 160 spell = function(self) return select(7, GetSpellInfo(self.actionID)) end,
Nenue@14 161 petaction = function(self) return self.pickupSlot, self.pickupBook end,
Nenue@14 162 }
Nenue@14 163 kb.PickupSlot = function(self)
Nenue@15 164 if not (self.command and self.isAvailable) then
Nenue@14 165 return
Nenue@14 166 end
Nenue@14 167 print(self.actionType)
Nenue@14 168 if self.actionType == 'spell' then
Nenue@14 169 -- It can't be picked up if SpellInfo(name) returns void
Nenue@14 170 local dummy = GetSpellInfo(self.actionName)
Nenue@14 171 if not dummy then
Nenue@14 172 return
Nenue@14 173 end
Nenue@14 174 end
Nenue@14 175 if PickupAction[self.actionType] then
Nenue@14 176 if GetPickupValue[self.actionType] then
Nenue@14 177 PickupAction[self.actionType](GetPickupValue[self.actionType](self))
Nenue@14 178 else
Nenue@14 179 PickupAction[self.actionType](self.actionID)
Nenue@14 180 end
Nenue@14 181 kb.ReleaseSlot(self)
Nenue@14 182 kb.UpdateSlot(self)
Nenue@14 183 end
Nenue@14 184 end
Nenue@14 185 end
Nenue@14 186
Nenue@14 187
Nenue@14 188
Nenue@14 189 --- Updates profile assignment and button contents
Nenue@14 190 kb.UpdateSlot = function(self, force)
Nenue@14 191 local slot = self:GetID()
Nenue@14 192
Nenue@14 193 if force then
Nenue@14 194 if kb.currentProfile.buttons[slot] then
Nenue@14 195 kb.SetSlot(self, unpack(kb.currentProfile.buttons[slot]))
Nenue@14 196 else
Nenue@14 197 kb.ReleaseSlot(self)
Nenue@14 198 end
Nenue@14 199 end
Nenue@14 200
Nenue@14 201 if self.command then
Nenue@14 202 print('['..slot..'] =', self.command, GetBindingKey(self.command))
Nenue@14 203
Nenue@15 204 if not self.isAvailable then
Nenue@15 205 self.border:SetColorTexture(1,0,0,1)
Nenue@15 206 self.ignoreTexture:Show()
Nenue@14 207 else
Nenue@15 208 self.ignoreTexture:Hide()
Nenue@15 209
Nenue@15 210 if self.pending then
Nenue@15 211 self.border:SetColorTexture(unpack(BORDER_PENDING))
Nenue@15 212 elseif self.isDynamic then
Nenue@15 213 self.border:SetColorTexture(unpack(BORDER_DYNAMIC))
Nenue@15 214 else
Nenue@15 215 self.border:SetColorTexture(unpack(BORDER_ASSIGNED))
Nenue@15 216 end
Nenue@14 217 end
Nenue@14 218
Nenue@15 219
Nenue@14 220 if self.actionType == 'macro' then
Nenue@14 221 self.macro:Show()
Nenue@14 222 else
Nenue@14 223 self.macro:Hide()
Nenue@14 224 if self.actionType == 'spell' then
Nenue@14 225 local dummy = GetSpellInfo(self.actionName)
Nenue@14 226 if not dummy then
Nenue@14 227 self.icon:SetDesaturated(true)
Nenue@14 228 else
Nenue@14 229 self.icon:SetDesaturated(false)
Nenue@14 230 end
Nenue@14 231
Nenue@14 232 end
Nenue@14 233 end
Nenue@14 234
Nenue@14 235 if self.isDynamic then
Nenue@15 236 print('|cFF00BBFFUpdateSlot|r:', self.isDynamic, self.isAvailable, self.actionID)
Nenue@14 237 end
Nenue@14 238
Nenue@14 239 if self.isDynamic == 'profession' then
Nenue@14 240 local profText = (self.spellNum == 1) and TRADE_SKILLS or (BUTTON_HEADERS[self.profIndex] or GetProfessionInfo(self.profIndex))
Nenue@14 241 if self.isAvailable then
Nenue@14 242 print(self.profIndex, 'spnum', type(self.spellNum), (self.spellNum == 1))
Nenue@14 243
Nenue@14 244 self.statusText = '|cFFFFFF00'..profText..'|r'
Nenue@14 245 self.bindingText = kb.BindingString(GetBindingKey(self.command))
Nenue@14 246 else
Nenue@14 247 self.statusText = '|cFFFF4400'..profText..'|r'
Nenue@14 248 self.actionName = '(need to train profession #'..self.profNum..')'
Nenue@14 249 self.bindingText ='?'
Nenue@14 250 end
Nenue@14 251 elseif self.isDynamic == 'talent' then
Nenue@14 252
Nenue@14 253 self.statusText = '|cFF00FFFF'.. TALENT .. '|r'
Nenue@14 254 if self.isAvailable then
Nenue@14 255 self.bindingText = kb.BindingString(GetBindingKey(self.command))
Nenue@14 256 else
Nenue@14 257 if kb.inactiveTalentBindings[self.actionID] then
Nenue@14 258 print(self.actionID, #kb.inactiveTalentBindings[self.actionID])
Nenue@14 259 self.bindingText= kb.BindingString(unpack(kb.inactiveTalentBindings[self.actionID]))
Nenue@14 260 end
Nenue@14 261
Nenue@14 262 end
Nenue@15 263 elseif self.isDynamic == 'petaction' and self.command:match("special") then
Nenue@15 264 self.statusText = '|cFF00FF00Pet Special|r'
Nenue@15 265 self.bindingText = kb.BindingString(GetBindingKey(self.command))
Nenue@14 266 else
Nenue@14 267 self.statusText = '|cFF00FF00'.. (BUTTON_HEADERS[self.actionType] and BUTTON_HEADERS[self.actionType] or self.actionType) .. '|r'
Nenue@14 268 self.bindingText = kb.BindingString(GetBindingKey(self.command))
Nenue@14 269 end
Nenue@14 270
Nenue@14 271 local locked, layer = kb.IsCommandBound(self)
Nenue@14 272 if locked then
Nenue@14 273 self.icon:SetAlpha(0.5)
Nenue@14 274 else
Nenue@14 275 self.icon:SetAlpha(1)
Nenue@14 276 end
Nenue@14 277
Nenue@14 278 if self.actionType == 'spell' then
Nenue@14 279 self.icon:SetTexture(GetSpellTexture(self.actionID))
Nenue@14 280 end
Nenue@14 281 end
Nenue@14 282
Nenue@14 283 if not self.isAvailable then
Nenue@14 284 self.bind:SetTextColor(0.7,0.7,0.7,1)
Nenue@14 285 else
Nenue@14 286 self.bind:SetTextColor(1,1,1,1)
Nenue@14 287 end
Nenue@14 288
Nenue@14 289 self.header:SetText(self.statusText)
Nenue@14 290 self.bind:SetText(self.bindingText)
Nenue@14 291 self.details:SetText(self.actionName)
Nenue@14 292 end
Nenue@14 293
Nenue@14 294 --- Resets button command
Nenue@14 295 kb.ReleaseSlot = function(self)
Nenue@14 296 local slot = self:GetID()
Nenue@14 297
Nenue@14 298
Nenue@14 299 if kb.currentProfile.buttons[slot] then
Nenue@14 300 kb.currentProfile.buttons[slot] = nil
Nenue@14 301 end
Nenue@14 302 if self.command then
Nenue@14 303 kb.currentProfile.commands[self.command] = nil
Nenue@14 304 end
Nenue@14 305 if self.actionType == 'spell' and IsTalentSpell(self.actionName) then
Nenue@14 306 if kb.currentProfile.talents[self.actionID] then
Nenue@14 307 kb.currentProfile.talents[self.actionID] = nil
Nenue@14 308 end
Nenue@14 309 end
Nenue@14 310 local droppedKeys = {}
Nenue@14 311
Nenue@14 312 -- doing removal in second loop to avoid possible iterator shenanigans
Nenue@14 313 for k,v in pairs(kb.currentProfile.bindings) do
Nenue@14 314 if v == self.command then
Nenue@14 315 tinsert(droppedKeys, k)
Nenue@14 316 end
Nenue@14 317 end
Nenue@14 318 if #droppedKeys >=1 then
Nenue@14 319 for i, k in ipairs(droppedKeys) do
Nenue@14 320 kb.currentProfile.bindings[k] = nil
Nenue@14 321 end
Nenue@14 322 end
Nenue@14 323
Nenue@14 324 self.isAvailable = nil
Nenue@14 325 self.isDynamic = nil
Nenue@14 326 self.bindingText = nil
Nenue@14 327 self.statusText = nil
Nenue@14 328 self.command = nil
Nenue@14 329 self.actionType = nil
Nenue@14 330 self.actionID = nil
Nenue@14 331 self.actionName = nil
Nenue@14 332 self.pickupSlot = nil
Nenue@14 333 self.pickupBook = nil
Nenue@14 334 self.macroName = nil
Nenue@14 335 self.profile = nil
Nenue@14 336 self.icon:SetTexture(nil)
Nenue@14 337 self.border:SetColorTexture(unpack(BORDER_UNASSIGNED))
Nenue@14 338 self:EnableKeyboard(false)
Nenue@14 339 self:SetScript('OnKeyDown', nil)
Nenue@15 340 self.ignoreTexture:Hide()
Nenue@14 341 end
Nenue@14 342
Nenue@14 343 kb.SetSlot = function(self, command, name, icon, actionType, actionID, macroName, macroText, pickupSlot, pickupBook)
Nenue@14 344 local slot = self:GetID()
Nenue@14 345 local isDynamic, isAvailable
Nenue@14 346
Nenue@14 347 print('|cFFFFFF00SetSlot|r:', self:GetID())
Nenue@14 348 if command then
Nenue@14 349
Nenue@14 350 if actionType == 'spell' then
Nenue@14 351 local professionNum, spellNum = command:match("profession_(%d)_(%d)")
Nenue@14 352
Nenue@14 353 if (professionNum and spellNum) then
Nenue@14 354 isDynamic = 'profession'
Nenue@14 355 local cacheInfo = kb.ProfessionCache[professionNum..'_'..spellNum]
Nenue@14 356 if cacheInfo then
Nenue@14 357 isAvailable = true
Nenue@14 358 name = cacheInfo.spellName
Nenue@14 359 icon = cacheInfo.icon
Nenue@14 360 actionID = cacheInfo.spellID
Nenue@14 361 self.profIndex = cacheInfo.profIndex
Nenue@14 362 self.spellOffset = cacheInfo.spellOffset
Nenue@14 363 end
Nenue@14 364 print(' Special slot: |cFF00FFFFProfession|r', professionNum, spellNum, isDynamic, isAvailable)
Nenue@14 365
Nenue@14 366 self.professionNum = tonumber(professionNum)
Nenue@14 367 self.spellNum = tonumber(spellNum)
Nenue@14 368
Nenue@14 369 else
Nenue@14 370 if kb.TalentCache[actionID] then
Nenue@14 371 isDynamic = 'talent'
Nenue@14 372 print(' Special slot: |cFFBBFF00talent|r', name, isAvailable)
Nenue@14 373 end
Nenue@14 374
Nenue@14 375 isAvailable = GetSpellInfo(name)
Nenue@14 376 end
Nenue@15 377 elseif actionType == 'petaction' then
Nenue@15 378 isDynamic = 'petaction'
Nenue@15 379 if kb.PetCache.spellslot and kb.PetCache.spellslot[name] then
Nenue@15 380 isAvailable = true
Nenue@15 381 kb.RemoveCacheButton(kb.petFrames, self)
Nenue@15 382 else
Nenue@15 383 print('|cFFFF4400OnCacheUpdate, re-do #', slot)
Nenue@15 384 tinsert(kb.petFrames, self)
Nenue@15 385 end
Nenue@14 386 elseif actionType == 'macro' then
Nenue@14 387 if not actionID then
Nenue@14 388 actionID = GetMacroIndexByName(name)
Nenue@14 389 end
Nenue@14 390 isAvailable = true
Nenue@14 391 else
Nenue@14 392 --- Journal selections
Nenue@14 393 -- todo: consider using the deep end of blizzard action bar instead
Nenue@14 394 if not actionID then
Nenue@14 395 actionID = command:match("^KeyBinderMacro:(.+)")
Nenue@14 396 end
Nenue@14 397 isAvailable = true
Nenue@14 398 end
Nenue@14 399
Nenue@14 400 if isAvailable then
Nenue@14 401 local oldCommand = command
Nenue@14 402 macroName, macroText, command = kb.RegisterAction(actionType, actionID, name)
Nenue@14 403 if oldCommand ~= command then
Nenue@14 404 print('|cFFFF4400fixing command string', actionType, actionID, name)
Nenue@14 405 kb.currentProfile.bound[oldCommand] = nil
Nenue@14 406 kb.currentProfile.bound[command] = slot
Nenue@14 407 for k,v in pairs(kb.currentProfile.bindings) do
Nenue@14 408 if v == oldCommand then
Nenue@14 409 kb.currentProfile.bindings[k] = command
Nenue@14 410 end
Nenue@14 411 end
Nenue@14 412 end
Nenue@14 413 kb.LoadBinding(command, name, icon, actionType, actionID, macroName, macroText)
Nenue@14 414 end
Nenue@14 415
Nenue@14 416
Nenue@14 417 actionID = actionID or 0
Nenue@14 418 self:EnableKeyboard(true)
Nenue@15 419 print(' |cFF00FF00kb.currentProfile.buttons['..slot..'] |cFF00FFFF=|r |cFF00FFFF"'.. command.. '"|r |cFF00FF00"'.. name.. '"|r |cFFFFFF00icon:'.. icon .. '|r |cFFFF8800"'.. actionType, '"|r |cFFFF0088id:'.. actionID ..'|r |cFF00FF00"'.. macroName .. '"|r')
Nenue@14 420 kb.currentProfile.buttons[slot] = {command, name, icon, actionType, actionID, macroName, macroText, pickupSlot, pickupBook}
Nenue@14 421
Nenue@14 422 -- Clean up conflicting entries for loaded button
Nenue@14 423 local previous = kb.currentProfile.commands[command]
Nenue@14 424 if previous ~= slot and kb.buttons[previous] then
Nenue@14 425 kb.ReleaseSlot(kb.buttons[previous])
Nenue@14 426 end
Nenue@14 427 kb.currentProfile.commands[command] = slot
Nenue@14 428 end
Nenue@14 429
Nenue@14 430 self.isAvailable = isAvailable
Nenue@14 431 self.isDynamic = isDynamic
Nenue@14 432
Nenue@15 433 self.pickupSlot = pickupSlot
Nenue@15 434 self.pickupBook = pickupBook
Nenue@14 435 self.macroText = macroText
Nenue@14 436 self.macroName = macroName
Nenue@14 437 self.actionType = actionType
Nenue@14 438 self.actionID = actionID
Nenue@14 439 self.actionName = name
Nenue@14 440 self.command = command
Nenue@14 441 self.icon:SetTexture(icon)
Nenue@14 442 self.profile = kb.db.bindMode
Nenue@14 443 self:RegisterForDrag('LeftButton')
Nenue@14 444 end
Nenue@14 445
Nenue@14 446
Nenue@14 447
Nenue@14 448 --- Add to blizzard interfaces
Nenue@14 449 StaticPopupDialogs["SKELETONKEY_CONFIRM_ASSIGN_SLOT"] = {
Nenue@14 450 text = "Confirm moving an assigned command.",
Nenue@14 451 button1 = OKAY,
Nenue@14 452 button2 = CANCEL,
Nenue@14 453 timeout = 0,
Nenue@14 454 whileDead = 1,
Nenue@14 455 showAlert = 1,
Nenue@14 456 OnAccept = kb.AcceptAssignment,
Nenue@14 457 OnCancel = function() kb:SetScript('OnMouseWheel', KeyBinder_OnMouseWheel) end
Nenue@14 458 }