Don't use hardcoded strings like "SPACE", "INSERT", "(s%-)", use global variables instead, e.g. SHIFT_KEY_TEXT, KEY_SPACE, KEY_INSERT, cuz different languages use different names for said keys
I do something like this and it works fine...
Lua Code:
local name = button:GetName()
local bType = button.buttonType
if not bType then
if name and not string.match(name, "Stance") then
if string.match(name, "PetAction") then
bType = "BONUSACTIONBUTTON"
else
bType = "ACTIONBUTTON"
end
end
end
local text = bType and GetBindingText(GetBindingKey(bType..button:GetID())) or ""
if text and text ~= "" then
text = string.gsub(text, SHIFT_KEY_TEXT, "S")
text = string.gsub(text, CTRL_KEY_TEXT, "C")
text = string.gsub(text, ALT_KEY_TEXT, "A")
text = string.gsub(text, KEY_BUTTON1, "LM")
text = string.gsub(text, KEY_BUTTON2, "RM")
text = string.gsub(text, KEY_BUTTON3, "MM")
text = string.gsub(text, KEY_MOUSEWHEELDOWN, "MWD")
text = string.gsub(text, KEY_MOUSEWHEELUP, "MWU")
text = string.gsub(text, KEY_SPACE, "SP")
text = string.gsub(text, "%-", "")
end
P.S. high lvl necromancy