WoWInterface SVN KeyboardAccess

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 10 to Rev 11
    Reverse comparison

Rev 10 → Rev 11

core.lua
50,6 → 50,16
end
end
 
local function inTable(tbl,value)
local b = false
for i,k in ipairs(tbl) do
if k==value then
return i
end
end
return b
end
 
function events:MODIFIER_STATE_CHANGED(modi,state) --required for still opening chat or config
if modi=='LSHIFT' or modi=='RSHIFT' then
KA.MODShift=toboolean(state)
71,6 → 81,36
--print(initiator)
tinsert(KA.handleT,'ReadyCheckFrame')
KA.handler:EnableKeyboard(1)
local RCFYB_OnClick = ReadyCheckFrameYesButton:GetScript('OnClick')
ReadyCheckFrameYesButton:SetScript('OnClick',function(self, button, down)
if button=='LeftButton' and not down then
RCFYB_OnClick(button,down)
local num = inTable(KA.handleT,'ReadyCheckFrame')
print(num)
if num then
print('removing', 'READY_CHECK')
tremove(KA.handleT,num)
if #KA.handleT==0 then
KA.handler:EnableKeyboard(0)
end
end
end
end)
local RCFNB_OnClick = ReadyCheckFrameNoButton:GetScript('OnClick')
ReadyCheckFrameNoButton:SetScript('OnClick',function(self, button, down)
if button=='LeftButton' and not down then
RCFNB_OnClick(button,down)
local num = inTable(KA.handleT,'ReadyCheckFrame')
print(num)
if num then
print('removing', 'READY_CHECK')
tremove(KA.handleT,num)
if #KA.handleT==0 then
KA.handler:EnableKeyboard(0)
end
end
end
end)
end
end
 
123,16 → 163,22
"EnterDungeonButton",
"LeaveQueueButton",
},
["ReadyCheckFrame"] = {
["ReadyCheckFrame"] = {
"YesButton",
"NoButton",
}
}
KA.oldShow = { }
KA.oldClick = { }
--storing old shows & creating new ones
for _,k in ipairs(popups) do
local name = k:GetName()
KA.oldShow[name] = k:GetScript('OnShow')
KA.oldClick[name]={}
 
KA.oldClick[name][1] = _G[name..buttonT[name][1]]:GetScript('OnClick') --accept button
KA.oldClick[name][2] = _G[name..buttonT[name][2]]:GetScript('OnClick') --decline button
 
k:SetScript('OnShow',function(...)
if not ( k.which =='REPLACE_ENCHANT' or k.which=='DEATH' or k.which=='RECOVER_CORPSE_INSTANCE' or k.which=='BUYOUT_AUCTION') then
tinsert(KA.handleT,name)
140,8 → 186,38
end
KA.oldShow[name](...)
end)
_G[name..buttonT[name][1]]:SetScript('OnClick',function(self, button, down)
if button=='LeftButton' and not down then
KA.oldClick[name][1](self,button,down)
local num = inTable(KA.handleT,name)
print(num)
if num then
print('removing', name)
tremove(KA.handleT,num)
if #KA.handleT==0 then
KA.handler:EnableKeyboard(0)
end
end
end
end)
_G[name..buttonT[name][2]]:SetScript('OnClick',function(self, button, down)
if button=='LeftButton' and not down then
KA.oldClick[name][2](self,button,down)
local num = inTable(KA.handleT,name)
print(num)
if num then
print('removing', name)
tremove(KA.handleT,num)
if #KA.handleT==0 then
KA.handler:EnableKeyboard(0)
end
end
end
end)
end
 
--fix clicking on buttons
 
--KeyPressing handling
KA.handler:SetScript('OnKeyDown',function(self,key)
if key=='LSHIFT' or key=='RSHIFT' then