Originally Posted by
Aridn
This worked exactly how I hoped! Thank you. The only issue I have is it doesn't load on login. I have to /reload in order for it to work.
That's odd, it may need to be delayed for login:
Code:
local f=CreateFrame("frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent",function()
local button=CreateFrame("button","MyCustomKeybind")
SetBindingClick("J",button:GetName())
button:SetScript("OnClick",function()
-- put code here
end)
end)
You also need to check the keybind menu for the key you chosen and unbind it, there might be some conflict there. When in the keybind menu, just click any unbound spot, bind your key, then unbind it.