• 0

    posted a message on Make something click through while pressing alt
    Quote from Dridzt
    f:RegisterEvent("MODIFIER_STATE_CHANGED")
    f:SetScript("OnEvent",
    function(self,event,...)
             if self[event] then
                     return self[event](...)
             end
    end)
    function f.MODIFIER_STATE_CHANGED(...)
        local key, state = ...
        if key == "LALT" or key == "RALT" then
            if state==1 then
                f:EnableMouse(true)
            elseif state==0 then
                f:EnableMouse(false)
            end
        end
    end
    Completely dry-coded.


    Alright that works beautifully. Thanks everyone for your help.
    Posted in: Need Help?
  • 0

    posted a message on Make something click through while pressing alt
    That just made it clickable at all times. Tried putting some print() statements to show key and state, but nothing was ever printed.
    Posted in: Need Help?
  • 0

    posted a message on Make something click through while pressing alt
    OK changed it to:
    f:SetScript("OnEvent", function(self, mod, arg2)
    if arg2 == "LALT" or arg2 =="RALT" then
    f:EnableMouse(true)
    else
    f:EnableMouse(false)
    end
    end)

    problem now is that once I press Alt...it stay clickable
    only becomes non clickable if i press a different modifier, like Ctrl.

    How would I make it register a key down then key up?
    so that when i press Alt and hold it, the mod is clickable,
    then when i release it, the mod becomes unclickable.
    Posted in: Need Help?
  • 0

    posted a message on Make something click through while pressing alt
    Still not picking up the Alt.
    Mouse stays disabled.
    Posted in: Need Help?
  • 0

    posted a message on Make something click through while pressing alt
    I have an issue where I want to make a mod click through when I hold Alt, but non clickable when Alt is not pressed.

    Using this to enable and disable the mouse:
    f:EnableMouse(true)

    Was trying to use f:RegisterEvent("MODIFIER_STATE_CHANGED") to capture the Alt press.
    But am unable to find an example of how to use it.

    Here is some code I found on WoWAce but it does not register the Alt press.
    f:RegisterEvent("MODIFIER_STATE_CHANGED")
    f:RegisterEvent("PLAYER_LOGIN")
    f:SetScript("OnEvent", function(mod, arg2)
    if mod == "LALT" or mod =="RALT" then
    if arg2 == 1 then
    f:EnableMouse(true)
    end
    else
    f:EnableMouse(false)
    end
    end)

    any help would be appreciated
    Posted in: Need Help?
  • To post a comment, please or register a new account.