#Modifier Text Display

5 messages · Page 1 of 1 (latest)

ocean solar
#

hello i made a weakaura that displays in text what modifier key is held but its set to update on every frame

how do i change it to update on trigger update what would i need to put for the trigger?

function ()
    local modifierKeys = ""
    if (IsShiftKeyDown()) then
        modifierKeys = modifierKeys .. "SHIFT"
    end
    if (IsControlKeyDown()) then
        if (modifierKeys ~= "") then
            modifierKeys = modifierKeys .. " + "
        end
        modifierKeys = modifierKeys .. "CONTROL"
    end
    if (IsAltKeyDown()) then
        if (modifierKeys ~= "") then
            modifierKeys = modifierKeys .. " + "
        end
        modifierKeys = modifierKeys .. "ALT"
    end
    return modifierKeys
end

Trigger custom status check on event(s) MODIFIER_STATE_CHANGED

function() return IsLeftShiftKeyDown() or IsLeftAltKeyDown() or IsLeftControlKeyDown() end
mortal sequoia
#

Trigger custom status check on event(s) MODIFIER_STATE_CHANGED
function() return IsLeftShiftKeyDown() or IsLeftAltKeyDown() or IsLeftControlKeyDown() end
This is a good start but you need the custom trigger to update also when you don't have a modifier down. So the custom trigger function can simply be function() return true end

Then you use "Name Info" to create the text that will be displayed (via %n in Display). In the Name Info box you can just put the Custom Text function you were using before

ocean solar
#

thanks that helped improve the performance a lot

#

do you know if its possible to change the function to display any button combo

#

for instance if i pressed Shift + 1 and then have it display "SHIFT + 1"